7 changed files with 823 additions and 507 deletions
@ -0,0 +1,247 @@ |
|||
<template> |
|||
<div class="commonLogPage" v-loading="state.loading"> |
|||
<!-- 主表 --> |
|||
<tablePage |
|||
:apiName="state.apiName" |
|||
:searchOptions="state.searchOptions" |
|||
:searchFilter="state.searchFilter" |
|||
@leftOperationHadel="leftOperationHadel" |
|||
:leftOperation="state.leftOperation" |
|||
:leftOperationColumnWidth="180" |
|||
:authName="props.authName" |
|||
:searchFilterOptions="state.searchFilterOptions" |
|||
:tableCellClassName="tableCellClassName" |
|||
></tablePage> |
|||
|
|||
<!-- 明细抽屉 --> |
|||
<el-drawer |
|||
class="commonLogPage_infoDrawerPop" |
|||
v-if="state.drawerShow" |
|||
v-model="state.drawerShow" |
|||
:title="`详情 (${state.infoCurrentRow.taskName} - uId:${state.infoCurrentRow.uId})`" |
|||
direction="rtl" |
|||
destroy-on-close |
|||
:size="'80%'" |
|||
@close="resetInfo" |
|||
> |
|||
<div style="height: 100%"> |
|||
<div style="height:calc(50% - 25px);" v-if="state.infoCurrentRow.path && state.infoCurrentRow.path != ''"> |
|||
<elTable |
|||
style="height:calc(100% - 50px)" |
|||
:tableData="state.infoTableDataTop" |
|||
:tableColumns="state.infoTableColumnsTop" |
|||
:columnWidth="state.infoTopType == 1 ? null : 150" |
|||
></elTable> |
|||
<elPager |
|||
v-if="state.infoTopType == 2" |
|||
style="margin-top: 15px;float:right" |
|||
:pager="state.infoPagerTop" |
|||
@pageSizeChange="pageSizeChange" |
|||
@pageCurrentChange="pageCurrentChange" |
|||
></elPager> |
|||
</div> |
|||
<div style="display: flex" :style="{height:state.infoCurrentRow.path && state.infoCurrentRow.path != '' ? 'calc(50% + 25px)' : '100%'}"> |
|||
<tablePage |
|||
v-if="state.drawerShow" |
|||
:specialPageApi='`/api/customlog/getlogreponselist`' |
|||
:tableColumns="state.infoTableColumns" |
|||
:specialColumnName="state.infoTableColumnsName" |
|||
:searchFilter="state.infoSearchFilter" |
|||
:hideSearch="true" |
|||
:hideSetColums="true" |
|||
></tablePage> |
|||
</div> |
|||
</div> |
|||
</el-drawer> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup> |
|||
defineOptions({ name: 'commonLogPage' }) |
|||
import { ElMessageBox, ElMessage,ElTable, ElTableColumn } from 'element-plus' |
|||
import { reactive, ref, onMounted,nextTick } from 'vue' |
|||
import tablePage from '@/components/tablePage/index.vue' |
|||
import elTable from '@/components/elTable/index.vue' |
|||
import elPager from '@/components/elPager/index.vue' |
|||
import { getLogJsonList } from '@/api/system/customlog' |
|||
import { downLoadJSONByString,getColoumsByServeName,getApiByServeName } from '@/utils/common/index' |
|||
import EnumList from '@/utils/common/enumList' |
|||
|
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
|
|||
const state = reactive({ |
|||
apiName:'customlog', |
|||
loading:false, |
|||
searchFilter: { |
|||
taskName: null, |
|||
creationTime:null, |
|||
module:'计划物流' |
|||
}, |
|||
searchOptions:[ |
|||
{type:'input',prop:'taskName',label:'任务名称'}, |
|||
{type:'datetimerange',prop:'creationTime',label:'创建时间'}, |
|||
], |
|||
searchFilterOptions:{ module:{action:'=='} }, |
|||
leftOperation:[ |
|||
{label:'查看详情',name:'showInfo',link:true,type:'primary'}, |
|||
{ |
|||
label:'下载JSON',name:'downloadJSON',link:true,type:'warning', |
|||
disabled:(row)=>{ |
|||
return !row.path || row.path == '' |
|||
} |
|||
}, |
|||
], |
|||
// 查看详情相关数据 |
|||
infoCurrentRow:null, |
|||
drawerShow:false, |
|||
infoTableDataTop:null,//详情上部数据 |
|||
infoTableColumnsTop:null, |
|||
infoAllDataTop:null, |
|||
infoTopType:null, |
|||
infoPagerTop:{ |
|||
page: 1, |
|||
pageSize: 10, |
|||
total: null, |
|||
}, |
|||
// 下部明细相关信息 |
|||
infoTableColumns:[], |
|||
// 查看详情内部colums的名称 |
|||
infoTableColumnsName:null, |
|||
infoSearchFilter: {}, |
|||
}) |
|||
|
|||
const props = defineProps({ |
|||
// 区分类别如:计划物流,生产质量 |
|||
pageModule: { |
|||
type: String, |
|||
default: null |
|||
}, |
|||
// 权限名称 |
|||
authName: { |
|||
type: String, |
|||
default: null |
|||
}, |
|||
}) |
|||
|
|||
state.searchFilter.module = props.pageModule |
|||
|
|||
function leftOperationHadel(btn,scope) { |
|||
// 查看详情 |
|||
if(btn.name == 'showInfo'){ |
|||
state.infoCurrentRow = scope.row |
|||
state.infoTableColumns = getColoumsByServeName(scope.row.taskName,'taskName',true) |
|||
state.infoTableColumnsName = getApiByServeName(scope.row.taskName,'taskName') |
|||
if(!state.infoTableColumnsName){ |
|||
ElMessage.error(`不支持的任务名: ${scope.row.taskName}`) |
|||
return |
|||
} |
|||
// 无路径不查上方数据 |
|||
if(!scope.row.path || scope.row.path == ''){ |
|||
state.drawerShow = true |
|||
return |
|||
} |
|||
state.infoSearchFilter = [ |
|||
{ |
|||
logic: "And", |
|||
column: 'uId', |
|||
action: '==', |
|||
value: scope.row.uId |
|||
}, |
|||
] |
|||
|
|||
state.loading = true |
|||
// 获取上部分信息 |
|||
getLogJsonList(scope.row.uId) |
|||
.then(res=>{ |
|||
// list格式 |
|||
if(JSON.parse(res.message) && JSON.parse(res.message).list){ |
|||
state.infoTopType=2 |
|||
state.infoTableColumnsTop = state.infoTableColumns.filter(item=>item.prop != 'writeState' && item.prop != 'readState') |
|||
state.infoAllDataTop = JSON.parse(res.message).list |
|||
state.infoPagerTop.total = state.infoAllDataTop.length |
|||
initInfoTopPagedata() |
|||
} |
|||
// data格式(仅有一条数据) |
|||
else{ |
|||
state.infoTopType=1 |
|||
state.infoTableColumnsTop=[ |
|||
{prop:'date',title:'date'}, |
|||
{prop:'pageSize',title:'pageSize'}, |
|||
{prop:'pageNum',title:'pageNum'}, |
|||
{prop:'isForce',title:'isForce'}, |
|||
] |
|||
state.infoTableDataTop = [JSON.parse(res.message)] |
|||
} |
|||
}) |
|||
|
|||
.finally(() => { |
|||
state.loading = false |
|||
state.drawerShow = true |
|||
}) |
|||
} |
|||
// 下载json |
|||
if(btn.name == 'downloadJSON'){ |
|||
state.loading = true |
|||
getLogJsonList(scope.row.uId) |
|||
.then(res=>{ |
|||
downLoadJSONByString(res.message,`${route.meta.title}_uid=${scope.row.uId}.json`) |
|||
}) |
|||
.finally(() => (state.loading = false)) |
|||
} |
|||
} |
|||
|
|||
// 上部分信息前端分页 |
|||
function initInfoTopPagedata() { |
|||
state.infoTableDataTop = state.infoAllDataTop.slice((state.infoPagerTop.page-1) * state.infoPagerTop.pageSize,state.infoPagerTop.page * state.infoPagerTop.pageSize) |
|||
} |
|||
|
|||
function pageSizeChange(data) { |
|||
state.infoPagerTop.pageSize = data |
|||
state.infoPagerTop.page = 1 |
|||
nextTick(() => { |
|||
initInfoTopPagedata() |
|||
}) |
|||
} |
|||
|
|||
function pageCurrentChange(data) { |
|||
state.infoPagerTop.page = data |
|||
nextTick(() => { |
|||
initInfoTopPagedata() |
|||
}) |
|||
} |
|||
|
|||
function resetInfo(){ |
|||
state.drawerShow=false |
|||
state.infoTableDataTop=null |
|||
state.infoTableColumns=[] |
|||
state.infoTableColumnsTop=[] |
|||
state.infoAllData=null |
|||
state.infoPagerTop={ |
|||
page: 1, |
|||
pageSize: 10, |
|||
total: null, |
|||
} |
|||
} |
|||
|
|||
// 单元格变色 |
|||
function tableCellClassName(data){ |
|||
if(data.row.type == '错误' && data.column.property == 'type'){return 'table-danger-row'} |
|||
else{return 'normal-tableRow'} |
|||
} |
|||
|
|||
</script> |
|||
<style scope lang="scss"> |
|||
.commonLogPage{ |
|||
height: 100%; |
|||
display: flex; |
|||
width:100%; |
|||
|
|||
.el-drawer__header { |
|||
margin-bottom:0 !important |
|||
} |
|||
} |
|||
.el-button--warning.is-link.is-disabled{ |
|||
color:#ccc !important |
|||
} |
|||
</style> |
@ -0,0 +1,219 @@ |
|||
<template> |
|||
<div class="logisticsPlanLogPage" v-loading="state.loading"> |
|||
<!-- 主表 --> |
|||
<tablePage |
|||
:apiName="state.apiName" |
|||
:searchOptions="state.searchOptions" |
|||
:searchFilter="state.searchFilter" |
|||
@leftOperationHadel="leftOperationHadel" |
|||
:leftOperation="state.leftOperation" |
|||
:leftOperationColumnWidth="180" |
|||
:authName="'logisticsPlanLog'" |
|||
:searchFilterOptions="state.searchFilterOptions" |
|||
:tableCellClassName="tableCellClassName" |
|||
></tablePage> |
|||
|
|||
<!-- 明细抽屉 --> |
|||
<el-drawer |
|||
class="logisticsPlanLog_infoDrawerPop" |
|||
v-if="state.drawerShow" |
|||
v-model="state.drawerShow" |
|||
:title="`详情 (${state.infoCurrentRow.taskName} - uId:${state.infoCurrentRow.uId})`" |
|||
direction="rtl" |
|||
destroy-on-close |
|||
:size="'80%'" |
|||
@close="resetInfo" |
|||
> |
|||
<div style="height: 100%"> |
|||
<div style="height:calc(50% - 25px);"> |
|||
<elTable |
|||
style="height:calc(100% - 50px)" |
|||
:tableData="state.infoTableDataTop" |
|||
:tableColumns="state.infoTableColumnsTop" |
|||
:columnWidth="state.infoTopType == 1 ? null : 150" |
|||
></elTable> |
|||
<elPager |
|||
v-if="state.infoTopType == 2" |
|||
style="margin-top: 15px;float:right" |
|||
:pager="state.infoPagerTop" |
|||
@pageSizeChange="pageSizeChange" |
|||
@pageCurrentChange="pageCurrentChange" |
|||
></elPager> |
|||
</div> |
|||
<div style="height:calc(50% + 25px);display: flex"> |
|||
<tablePage |
|||
v-if="state.drawerShow" |
|||
:specialPageApi='`/api/customlog/getlogreponselist`' |
|||
:tableColumns="state.infoTableColumns" |
|||
:specialColumnName="state.infoTableColumnsName" |
|||
:searchFilter="state.infoSearchFilter" |
|||
:hideSearch="true" |
|||
:hideSetColums="true" |
|||
></tablePage> |
|||
</div> |
|||
</div> |
|||
</el-drawer> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup> |
|||
defineOptions({ name: 'logisticsPlanLog' }) |
|||
import { ElMessageBox, ElMessage,ElTable, ElTableColumn } from 'element-plus' |
|||
import { reactive, ref, onMounted,nextTick } from 'vue' |
|||
import tablePage from '@/components/tablePage/index.vue' |
|||
import elTable from '@/components/elTable/index.vue' |
|||
import elPager from '@/components/elPager/index.vue' |
|||
import { getLogJsonList } from '@/api/system/customlog' |
|||
import { downLoadJSONByString,getColoumsByServeName,getApiByServeName } from '@/utils/common/index' |
|||
import EnumList from '@/utils/common/enumList' |
|||
|
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
|
|||
const state = reactive({ |
|||
apiName:'customlog', |
|||
loading:false, |
|||
searchFilter: { |
|||
taskName: null, |
|||
creationTime:null, |
|||
module:'计划物流' |
|||
}, |
|||
searchOptions:[ |
|||
{type:'input',prop:'taskName',label:'任务名称'}, |
|||
{type:'datetimerange',prop:'creationTime',label:'创建时间'}, |
|||
], |
|||
searchFilterOptions:{ module:{action:'=='} }, |
|||
leftOperation:[ |
|||
{label:'查看详情',name:'showInfo',link:true,type:'primary'}, |
|||
{label:'下载JSON',name:'downloadJSON',link:true,type:'warning'}, |
|||
], |
|||
// 查看详情相关数据 |
|||
infoCurrentRow:null, |
|||
drawerShow:false, |
|||
infoTableDataTop:null,//详情上部数据 |
|||
infoTableColumnsTop:null, |
|||
infoAllDataTop:null, |
|||
infoTopType:null, |
|||
infoPagerTop:{ |
|||
page: 1, |
|||
pageSize: 10, |
|||
total: null, |
|||
}, |
|||
// 下部明细相关信息 |
|||
infoTableColumns:[], |
|||
// 查看详情内部colums的名称 |
|||
infoTableColumnsName:null, |
|||
infoSearchFilter: {}, |
|||
}) |
|||
|
|||
function leftOperationHadel(btn,scope) { |
|||
// 查看详情 |
|||
if(btn.name == 'showInfo'){ |
|||
state.infoCurrentRow = scope.row |
|||
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 |
|||
}, |
|||
] |
|||
|
|||
state.loading = true |
|||
// 获取上部分信息 |
|||
getLogJsonList(scope.row.uId) |
|||
.then(res=>{ |
|||
// list格式 |
|||
if(JSON.parse(res.message) && JSON.parse(res.message).list){ |
|||
state.infoTopType=2 |
|||
state.infoTableColumnsTop = state.infoTableColumns.filter(item=>item.prop != 'writeState' && item.prop != 'readState') |
|||
state.infoAllDataTop = JSON.parse(res.message).list |
|||
state.infoPagerTop.total = state.infoAllDataTop.length |
|||
initInfoTopPagedata() |
|||
} |
|||
// data格式(仅有一条数据) |
|||
else{ |
|||
state.infoTopType=1 |
|||
state.infoTableColumnsTop=[ |
|||
{prop:'date',title:'date'}, |
|||
{prop:'pageSize',title:'pageSize'}, |
|||
{prop:'pageNum',title:'pageNum'}, |
|||
{prop:'isForce',title:'isForce'}, |
|||
] |
|||
state.infoTableDataTop = [JSON.parse(res.message)] |
|||
} |
|||
}) |
|||
|
|||
.finally(() => { |
|||
state.loading = false |
|||
state.drawerShow = true |
|||
}) |
|||
} |
|||
// 下载json |
|||
if(btn.name == 'downloadJSON'){ |
|||
state.loading = true |
|||
getLogJsonList(scope.row.uId) |
|||
.then(res=>{ |
|||
downLoadJSONByString(res.message,`${route.meta.title}_uid=${scope.row.uId}.json`) |
|||
}) |
|||
.finally(() => (state.loading = false)) |
|||
} |
|||
} |
|||
|
|||
// 上部分信息前端分页 |
|||
function initInfoTopPagedata() { |
|||
state.infoTableDataTop = state.infoAllDataTop.slice((state.infoPagerTop.page-1) * state.infoPagerTop.pageSize,state.infoPagerTop.page * state.infoPagerTop.pageSize) |
|||
} |
|||
|
|||
function pageSizeChange(data) { |
|||
state.infoPagerTop.pageSize = data |
|||
state.infoPagerTop.page = 1 |
|||
nextTick(() => { |
|||
initInfoTopPagedata() |
|||
}) |
|||
} |
|||
|
|||
function pageCurrentChange(data) { |
|||
state.infoPagerTop.page = data |
|||
nextTick(() => { |
|||
initInfoTopPagedata() |
|||
}) |
|||
} |
|||
|
|||
function resetInfo(){ |
|||
state.drawerShow=false |
|||
state.infoTableDataTop=null |
|||
state.infoTableColumns=[] |
|||
state.infoTableColumnsTop=[] |
|||
state.infoAllData=null |
|||
state.infoPagerTop={ |
|||
page: 1, |
|||
pageSize: 10, |
|||
total: null, |
|||
} |
|||
} |
|||
|
|||
// 单元格变色 |
|||
function tableCellClassName(data){ |
|||
if(data.row.type == '错误' && data.column.property == 'type'){return 'table-danger-row'} |
|||
else{return 'normal-tableRow'} |
|||
} |
|||
|
|||
</script> |
|||
<style scope lang="scss"> |
|||
.logisticsPlanLogPage{ |
|||
height: 100%; |
|||
display: flex; |
|||
width:100%; |
|||
|
|||
.el-drawer__header { |
|||
margin-bottom:0 !important |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,246 @@ |
|||
<template> |
|||
<div class="logisticsPlanLogPage" v-loading="state.loading"> |
|||
<!-- 主表 --> |
|||
<tablePage |
|||
:apiName="state.apiName" |
|||
:searchOptions="state.searchOptions" |
|||
:searchFilter="state.searchFilter" |
|||
@leftOperationHadel="leftOperationHadel" |
|||
:leftOperation="state.leftOperation" |
|||
:leftOperationColumnWidth="180" |
|||
:authName="'logisticsPlanLog'" |
|||
:searchFilterOptions="state.searchFilterOptions" |
|||
:tableCellClassName="tableCellClassName" |
|||
></tablePage> |
|||
|
|||
<!-- 明细抽屉 --> |
|||
<el-drawer |
|||
class="logisticsPlanLog_infoDrawerPop" |
|||
v-if="state.drawerShow" |
|||
v-model="state.drawerShow" |
|||
:title="`详情 (${state.infoCurrentRow.taskName} - uId:${state.infoCurrentRow.uId})`" |
|||
direction="rtl" |
|||
destroy-on-close |
|||
:size="'80%'" |
|||
@close="resetInfo" |
|||
> |
|||
<div style="height: 100%;display: flex"> |
|||
<tablePage |
|||
v-if="state.drawerShow" |
|||
:specialPageApi='`/api/customlog/getlogreponselist`' |
|||
:tableColumns="state.infoTableColumns" |
|||
:specialColumnName="state.infoTableColumnsName" |
|||
:specialLocalColumnName="state.infoTableColumnsName+'_LPLogDetail'" |
|||
:searchFilter="state.infoSearchFilter" |
|||
:hideSearch="true" |
|||
></tablePage> |
|||
<!-- 前端分页 --> |
|||
<!-- <elTable |
|||
style="height:calc(100% - 50px)" |
|||
:tableData="state.infoTableData" |
|||
:tableColumns="state.infoTableColumns" |
|||
:columnWidth="state.columnWidth" |
|||
></elTable> |
|||
<elPager |
|||
v-if="state.infoType == 2" |
|||
style="margin-top: 15px;float:right" |
|||
:pager="state.infoPager" |
|||
@pageSizeChange="pageSizeChange" |
|||
@pageCurrentChange="pageCurrentChange" |
|||
:isHideOnlyOne="true" |
|||
></elPager> --> |
|||
</div> |
|||
</el-drawer> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup> |
|||
defineOptions({ name: 'logisticsPlanLog' }) |
|||
import { ElMessageBox, ElMessage,ElTable, ElTableColumn } from 'element-plus' |
|||
import { reactive, ref, onMounted,nextTick } from 'vue' |
|||
import tablePage from '@/components/tablePage/index.vue' |
|||
import elTable from '@/components/elTable/index.vue' |
|||
import elPager from '@/components/elPager/index.vue' |
|||
import { getLogJsonList } from '@/api/system/customlog' |
|||
import { downLoadJSONByString,getColoumsByServeName,getApiByServeName } from '@/utils/common/index' |
|||
import EnumList from '@/utils/common/enumList' |
|||
|
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
|
|||
const state = reactive({ |
|||
apiName:'customlog', |
|||
loading:false, |
|||
searchFilter: { |
|||
taskName: null, |
|||
creationTime:null, |
|||
module:'计划物流' |
|||
}, |
|||
searchOptions:[ |
|||
{type:'input',prop:'taskName',label:'任务名称'}, |
|||
{type:'datetimerange',prop:'creationTime',label:'创建时间'}, |
|||
], |
|||
searchFilterOptions:{ module:{action:'=='} }, |
|||
leftOperation:[ |
|||
{label:'查看详情',name:'showInfo',link:true,type:'primary'}, |
|||
{label:'下载JSON',name:'downloadJSON',link:true,type:'warning'}, |
|||
], |
|||
// 查看详情相关数据 |
|||
drawerShow:false, |
|||
infoTableData:null, |
|||
infoTableColumns:[], |
|||
// 查看详情内部colums的名称 |
|||
infoTableColumnsName:null, |
|||
infoSearchFilter: {}, |
|||
columnWidth:null, |
|||
infoType:null, |
|||
infoAllData:null, |
|||
infoCurrentRow:null, |
|||
infoPager:{ |
|||
page: 1, |
|||
pageSize: 20, |
|||
total: null, |
|||
}, |
|||
}) |
|||
|
|||
function leftOperationHadel(btn,scope) { |
|||
// 查看详情(原) |
|||
// if(btn.name == 'showInfo'){ |
|||
// state.infoCurrentRow = scope.row |
|||
// // 应答格式:直接实体 state.infoType = 1 |
|||
// let _arr1 = [ |
|||
// '整车月度生产计划1','整车月度生产计划2','M+6月物料需求计划','日物料需求计划', |
|||
// '计划协议','采购订单','过焊装未过总装','过涂装未过总装','排序供货','看板配送单', |
|||
// '退货单','奇瑞RDC共享库存','日MRP状态监控','日MRP预警推移' |
|||
// ] |
|||
// // 应答格式:获取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)) |
|||
// } |
|||
// 查看详情 |
|||
if(btn.name == 'showInfo'){ |
|||
state.infoCurrentRow = scope.row |
|||
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 |
|||
}, |
|||
] |
|||
nextTick(() => { |
|||
state.drawerShow = true |
|||
}) |
|||
} |
|||
// 下载json |
|||
if(btn.name == 'downloadJSON'){ |
|||
state.loading = true |
|||
getLogJsonList(scope.row.uId) |
|||
.then(res=>{ |
|||
downLoadJSONByString(res.message,`${route.meta.title}_uid=${scope.row.uId}.json`) |
|||
}) |
|||
.finally(() => (state.loading = false)) |
|||
} |
|||
} |
|||
|
|||
// InfoType=2的前端分页 |
|||
function initInfoType2Pagedata() { |
|||
state.infoTableData = state.infoAllData.slice((state.infoPager.page-1) * state.infoPager.pageSize,state.infoPager.page * state.infoPager.pageSize) |
|||
} |
|||
|
|||
function pageSizeChange(data) { |
|||
state.infoPager.pageSize = data |
|||
state.infoPager.page = 1 |
|||
nextTick(() => { |
|||
initInfoType2Pagedata() |
|||
}) |
|||
} |
|||
|
|||
function pageCurrentChange(data) { |
|||
state.infoPager.page = data |
|||
nextTick(() => { |
|||
initInfoType2Pagedata() |
|||
}) |
|||
} |
|||
|
|||
function resetInfo(){ |
|||
state.drawerShow=false |
|||
state.infoTableData=null |
|||
state.infoTableColumns=[] |
|||
state.columnWidth=null |
|||
state.infoType=null |
|||
state.infoAllData=null |
|||
state.infoPager={ |
|||
page: 1, |
|||
pageSize: 20, |
|||
total: null, |
|||
} |
|||
} |
|||
|
|||
|
|||
// 单元格变色 |
|||
function tableCellClassName(data){ |
|||
if(data.row.type == '错误' && data.column.property == 'type'){return 'table-danger-row'} |
|||
else{return 'normal-tableRow'} |
|||
} |
|||
|
|||
</script> |
|||
<style scope lang="scss"> |
|||
.logisticsPlanLogPage{ |
|||
height: 100%; |
|||
display: flex; |
|||
width:100%; |
|||
|
|||
.el-drawer__header { |
|||
margin-bottom:0 !important |
|||
} |
|||
} |
|||
|
|||
.logisticsPlanLog_infoDrawerPop { |
|||
.search-container{ |
|||
position: fixed; |
|||
right: 71px; |
|||
top: 0px; |
|||
box-shadow: none; |
|||
border: none; |
|||
height: 60px; |
|||
} |
|||
} |
|||
</style> |
@ -1,246 +1,8 @@ |
|||
<template> |
|||
<div class="logisticsPlanLogPage" v-loading="state.loading"> |
|||
<!-- 主表 --> |
|||
<tablePage |
|||
:apiName="state.apiName" |
|||
:searchOptions="state.searchOptions" |
|||
:searchFilter="state.searchFilter" |
|||
@leftOperationHadel="leftOperationHadel" |
|||
:leftOperation="state.leftOperation" |
|||
:leftOperationColumnWidth="180" |
|||
:authName="'logisticsPlanLog'" |
|||
:searchFilterOptions="state.searchFilterOptions" |
|||
:tableCellClassName="tableCellClassName" |
|||
></tablePage> |
|||
|
|||
<!-- 明细抽屉 --> |
|||
<el-drawer |
|||
class="logisticsPlanLog_infoDrawerPop" |
|||
v-if="state.drawerShow" |
|||
v-model="state.drawerShow" |
|||
:title="`详情 (${state.infoCurrentRow.taskName} - uId:${state.infoCurrentRow.uId})`" |
|||
direction="rtl" |
|||
destroy-on-close |
|||
:size="'80%'" |
|||
@close="resetInfo" |
|||
> |
|||
<div style="height: 100%;display: flex"> |
|||
<tablePage |
|||
v-if="state.drawerShow" |
|||
:specialPageApi='`/api/customlog/getlogreponselist`' |
|||
:tableColumns="state.infoTableColumns" |
|||
:specialColumnName="state.infoTableColumnsName" |
|||
:specialLocalColumnName="state.infoTableColumnsName+'_LPLogDetail'" |
|||
:searchFilter="state.infoSearchFilter" |
|||
:hideSearch="true" |
|||
></tablePage> |
|||
<!-- 前端分页 --> |
|||
<!-- <elTable |
|||
style="height:calc(100% - 50px)" |
|||
:tableData="state.infoTableData" |
|||
:tableColumns="state.infoTableColumns" |
|||
:columnWidth="state.columnWidth" |
|||
></elTable> |
|||
<elPager |
|||
v-if="state.infoType == 2" |
|||
style="margin-top: 15px;float:right" |
|||
:pager="state.infoPager" |
|||
@pageSizeChange="pageSizeChange" |
|||
@pageCurrentChange="pageCurrentChange" |
|||
:isHideOnlyOne="true" |
|||
></elPager> --> |
|||
</div> |
|||
</el-drawer> |
|||
</div> |
|||
<commonLogPage pageModule="计划物流" authName="logisticsPlanLog"></commonLogPage> |
|||
</template> |
|||
|
|||
<script setup> |
|||
defineOptions({ name: 'logisticsPlanLog' }) |
|||
import { ElMessageBox, ElMessage,ElTable, ElTableColumn } from 'element-plus' |
|||
import { reactive, ref, onMounted,nextTick } from 'vue' |
|||
import tablePage from '@/components/tablePage/index.vue' |
|||
import elTable from '@/components/elTable/index.vue' |
|||
import elPager from '@/components/elPager/index.vue' |
|||
import { getLogJsonList } from '@/api/system/customlog' |
|||
import { downLoadJSONByString,getColoumsByServeName,getApiByServeName } from '@/utils/common/index' |
|||
import EnumList from '@/utils/common/enumList' |
|||
|
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
|
|||
const state = reactive({ |
|||
apiName:'customlog', |
|||
loading:false, |
|||
searchFilter: { |
|||
taskName: null, |
|||
creationTime:null, |
|||
module:'计划物流' |
|||
}, |
|||
searchOptions:[ |
|||
{type:'input',prop:'taskName',label:'任务名称'}, |
|||
{type:'datetimerange',prop:'creationTime',label:'创建时间'}, |
|||
], |
|||
searchFilterOptions:{ module:{action:'=='} }, |
|||
leftOperation:[ |
|||
{label:'查看详情',name:'showInfo',link:true,type:'primary'}, |
|||
{label:'下载JSON',name:'downloadJSON',link:true,type:'warning'}, |
|||
], |
|||
// 查看详情相关数据 |
|||
drawerShow:false, |
|||
infoTableData:null, |
|||
infoTableColumns:[], |
|||
// 查看详情内部colums的名称 |
|||
infoTableColumnsName:null, |
|||
infoSearchFilter: {}, |
|||
columnWidth:null, |
|||
infoType:null, |
|||
infoAllData:null, |
|||
infoCurrentRow:null, |
|||
infoPager:{ |
|||
page: 1, |
|||
pageSize: 20, |
|||
total: null, |
|||
}, |
|||
}) |
|||
|
|||
function leftOperationHadel(btn,scope) { |
|||
// 查看详情(原) |
|||
// if(btn.name == 'showInfo'){ |
|||
// state.infoCurrentRow = scope.row |
|||
// // 应答格式:直接实体 state.infoType = 1 |
|||
// let _arr1 = [ |
|||
// '整车月度生产计划1','整车月度生产计划2','M+6月物料需求计划','日物料需求计划', |
|||
// '计划协议','采购订单','过焊装未过总装','过涂装未过总装','排序供货','看板配送单', |
|||
// '退货单','奇瑞RDC共享库存','日MRP状态监控','日MRP预警推移' |
|||
// ] |
|||
// // 应答格式:获取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)) |
|||
// } |
|||
// 查看详情 |
|||
if(btn.name == 'showInfo'){ |
|||
state.infoCurrentRow = scope.row |
|||
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 |
|||
}, |
|||
] |
|||
nextTick(() => { |
|||
state.drawerShow = true |
|||
}) |
|||
} |
|||
// 下载json |
|||
if(btn.name == 'downloadJSON'){ |
|||
state.loading = true |
|||
getLogJsonList(scope.row.uId) |
|||
.then(res=>{ |
|||
downLoadJSONByString(res.message,`${route.meta.title}_uid=${scope.row.uId}.json`) |
|||
}) |
|||
.finally(() => (state.loading = false)) |
|||
} |
|||
} |
|||
|
|||
// InfoType=2的前端分页 |
|||
function initInfoType2Pagedata() { |
|||
state.infoTableData = state.infoAllData.slice((state.infoPager.page-1) * state.infoPager.pageSize,state.infoPager.page * state.infoPager.pageSize) |
|||
} |
|||
|
|||
function pageSizeChange(data) { |
|||
state.infoPager.pageSize = data |
|||
state.infoPager.page = 1 |
|||
nextTick(() => { |
|||
initInfoType2Pagedata() |
|||
}) |
|||
} |
|||
|
|||
function pageCurrentChange(data) { |
|||
state.infoPager.page = data |
|||
nextTick(() => { |
|||
initInfoType2Pagedata() |
|||
}) |
|||
} |
|||
|
|||
function resetInfo(){ |
|||
state.drawerShow=false |
|||
state.infoTableData=null |
|||
state.infoTableColumns=[] |
|||
state.columnWidth=null |
|||
state.infoType=null |
|||
state.infoAllData=null |
|||
state.infoPager={ |
|||
page: 1, |
|||
pageSize: 20, |
|||
total: null, |
|||
} |
|||
} |
|||
|
|||
|
|||
// 单元格变色 |
|||
function tableCellClassName(data){ |
|||
if(data.row.type == '错误' && data.column.property == 'type'){return 'table-danger-row'} |
|||
else{return 'normal-tableRow'} |
|||
} |
|||
|
|||
</script> |
|||
<style scope lang="scss"> |
|||
.logisticsPlanLogPage{ |
|||
height: 100%; |
|||
display: flex; |
|||
width:100%; |
|||
|
|||
.el-drawer__header { |
|||
margin-bottom:0 !important |
|||
} |
|||
} |
|||
|
|||
.logisticsPlanLog_infoDrawerPop { |
|||
.search-container{ |
|||
position: fixed; |
|||
right: 71px; |
|||
top: 0px; |
|||
box-shadow: none; |
|||
border: none; |
|||
height: 60px; |
|||
} |
|||
} |
|||
</style> |
|||
import commonLogPage from './../components/commonLogPage.vue' |
|||
</script> |
@ -1,186 +1,8 @@ |
|||
<template> |
|||
<div class="productionQualityLogPage" v-loading="state.loading"> |
|||
<!-- 主表 --> |
|||
<tablePage |
|||
:apiName="state.apiName" |
|||
:searchOptions="state.searchOptions" |
|||
:searchFilter="state.searchFilter" |
|||
@leftOperationHadel="leftOperationHadel" |
|||
:leftOperation="state.leftOperation" |
|||
:leftOperationColumnWidth="180" |
|||
:authName="'productionQualityLog'" |
|||
:searchFilterOptions="state.searchFilterOptions" |
|||
:tableCellClassName="tableCellClassName" |
|||
></tablePage> |
|||
|
|||
<!-- 明细抽屉 --> |
|||
<el-drawer |
|||
class="productionQualityLog_infoDrawerPop" |
|||
v-if="state.drawerShow" |
|||
v-model="state.drawerShow" |
|||
:title="`详情 (${state.infoCurrentRow.taskName} - uId:${state.infoCurrentRow.uId})`" |
|||
direction="rtl" |
|||
destroy-on-close |
|||
:size="'80%'" |
|||
@close="resetInfo" |
|||
> |
|||
<div style="height: 100%;display: flex"> |
|||
<tablePage |
|||
v-if="state.drawerShow" |
|||
:specialPageApi='`/api/customlog/getlogreponselist`' |
|||
:tableColumns="state.infoTableColumns" |
|||
:specialColumnName="state.infoTableColumnsName" |
|||
:specialLocalColumnName="state.infoTableColumnsName+'_PQLogDetail'" |
|||
:searchFilter="state.infoSearchFilter" |
|||
:hideSearch="true" |
|||
></tablePage> |
|||
</div> |
|||
</el-drawer> |
|||
</div> |
|||
<commonLogPage pageModule="生产质量" authName="productionQualityLog"></commonLogPage> |
|||
</template> |
|||
|
|||
<script setup> |
|||
defineOptions({ name: 'productionQualityLog' }) |
|||
import { ElMessageBox, ElMessage,ElTable, ElTableColumn } from 'element-plus' |
|||
import { reactive, ref, onMounted,nextTick } from 'vue' |
|||
import tablePage from '@/components/tablePage/index.vue' |
|||
import elTable from '@/components/elTable/index.vue' |
|||
import elPager from '@/components/elPager/index.vue' |
|||
import { getLogJsonList } from '@/api/system/customlog' |
|||
import { downLoadJSONByString,getColoumsByServeName,getApiByServeName } from '@/utils/common/index' |
|||
import EnumList from '@/utils/common/enumList' |
|||
|
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
|
|||
const state = reactive({ |
|||
apiName:'customlog', |
|||
loading:false, |
|||
searchFilter: { |
|||
taskName: null, |
|||
creationTime:null, |
|||
module:'生产质量' |
|||
}, |
|||
searchOptions:[ |
|||
{type:'input',prop:'taskName',label:'任务名称'}, |
|||
{type:'datetimerange',prop:'creationTime',label:'创建时间'}, |
|||
], |
|||
searchFilterOptions:{ module:{action:'=='} }, |
|||
leftOperation:[ |
|||
{label:'查看详情',name:'showInfo',link:true,type:'primary'}, |
|||
{label:'下载JSON',name:'downloadJSON',link:true,type:'warning'}, |
|||
], |
|||
// 查看详情相关数据 |
|||
drawerShow:false, |
|||
infoTableData:null, |
|||
infoTableColumns:[], |
|||
// 查看详情内部colums的名称 |
|||
infoTableColumnsName:null, |
|||
infoSearchFilter: {}, |
|||
columnWidth:null, |
|||
infoType:null, |
|||
infoAllData:null, |
|||
infoCurrentRow:null, |
|||
infoPager:{ |
|||
page: 1, |
|||
pageSize: 20, |
|||
total: null, |
|||
}, |
|||
}) |
|||
|
|||
function leftOperationHadel(btn,scope) { |
|||
// 查看详情 |
|||
if(btn.name == 'showInfo'){ |
|||
state.infoCurrentRow = scope.row |
|||
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 |
|||
}, |
|||
] |
|||
nextTick(() => { |
|||
state.drawerShow = true |
|||
}) |
|||
} |
|||
// 下载json |
|||
if(btn.name == 'downloadJSON'){ |
|||
state.loading = true |
|||
getLogJsonList(scope.row.uId) |
|||
.then(res=>{ |
|||
downLoadJSONByString(res.message,`${route.meta.title}_uid=${scope.row.uId}.json`) |
|||
}) |
|||
.finally(() => (state.loading = false)) |
|||
} |
|||
} |
|||
|
|||
// InfoType=2的前端分页 |
|||
function initInfoType2Pagedata() { |
|||
state.infoTableData = state.infoAllData.slice((state.infoPager.page-1) * state.infoPager.pageSize,state.infoPager.page * state.infoPager.pageSize) |
|||
} |
|||
|
|||
function pageSizeChange(data) { |
|||
state.infoPager.pageSize = data |
|||
state.infoPager.page = 1 |
|||
nextTick(() => { |
|||
initInfoType2Pagedata() |
|||
}) |
|||
} |
|||
|
|||
function pageCurrentChange(data) { |
|||
state.infoPager.page = data |
|||
nextTick(() => { |
|||
initInfoType2Pagedata() |
|||
}) |
|||
} |
|||
|
|||
function resetInfo(){ |
|||
state.drawerShow=false |
|||
state.infoTableData=null |
|||
state.infoTableColumns=[] |
|||
state.columnWidth=null |
|||
state.infoType=null |
|||
state.infoAllData=null |
|||
state.infoPager={ |
|||
page: 1, |
|||
pageSize: 20, |
|||
total: null, |
|||
} |
|||
} |
|||
|
|||
// 单元格变色 |
|||
function tableCellClassName(data){ |
|||
if(data.row.type == '错误' && data.column.property == 'type'){return 'table-danger-row'} |
|||
else{return 'normal-tableRow'} |
|||
} |
|||
|
|||
</script> |
|||
<style scope lang="scss"> |
|||
.productionQualityLogPage{ |
|||
height: 100%; |
|||
display: flex; |
|||
width:100%; |
|||
|
|||
.el-drawer__header { |
|||
margin-bottom:0 !important |
|||
} |
|||
} |
|||
|
|||
.productionQualityLog_infoDrawerPop { |
|||
.search-container{ |
|||
position: fixed; |
|||
right: 71px; |
|||
top: 0px; |
|||
box-shadow: none; |
|||
border: none; |
|||
height: 60px; |
|||
} |
|||
} |
|||
</style> |
|||
import commonLogPage from './../components/commonLogPage.vue' |
|||
</script> |
Loading…
Reference in new issue