Browse Source

【EDI】pc前端

web
安虹睿 2 weeks ago
parent
commit
ab875ebcb3
  1. 35
      Web/src/utils/common/apiTableColumns.js
  2. 247
      Web/src/views/task/components/commonLogPage.vue
  3. 219
      Web/src/views/task/logisticsPlanLog/index copy 2.vue
  4. 246
      Web/src/views/task/logisticsPlanLog/index copy.vue
  5. 244
      Web/src/views/task/logisticsPlanLog/index.vue
  6. 155
      Web/src/views/task/productionQualityLog/index copy.vue
  7. 184
      Web/src/views/task/productionQualityLog/index.vue

35
Web/src/utils/common/apiTableColumns.js

@ -51,6 +51,7 @@ const apiTableColumns = {
// 整车月度生产计划2
supplierproplaning:[
{prop:'releaseEdition',title:'需求发布版次',width:150},
{prop:'materialCode',title:'物料号',width:150},
{prop:'models',title:'车型'},
{prop:'salseDepartment',title:'销售单位'},
{prop:'type',title:'类型'},
@ -75,7 +76,7 @@ const apiTableColumns = {
// M+6月物料需求计划
cherysuppliermrpmonth:[
{prop:'releaseEdition',title:'需求发布版次',width:150},
{prop:'materialCode',title:'零件号'},
{prop:'materialCode',title:'零件号',width:150},
{prop:'materialDescription',title:'零件名称'},
{prop:'plantId',title:'工厂代码'},
{prop:'plantName',title:'工厂名称'},
@ -106,7 +107,7 @@ const apiTableColumns = {
{prop:'readState',title:'是否已确认',type:'tagFilter',options:EnumList.whetherBoolean,width:120,noEdit:true},
{prop:'supplierCode',title:'供应商代码',width:120},
{prop:'releaseEdition',title:'需求发布版次',width:150},
{prop:'materialCode',title:'零件号'},
{prop:'materialCode',title:'零件号',width:150},
{prop:'plantId',title:'工厂代码',width:120},
{prop:'feedbackResults',title:'反馈结果',type:'filterSelect',options:EnumList.feedbackResults,required:true,noClear:true},
{prop:'ventureType',title:'风险类型',type:'filterSelect',options:EnumList.ventureType},
@ -130,7 +131,7 @@ const apiTableColumns = {
// M+6月物料需求计划风险确认-明细
cherysupplierconmmrpDetail:[
{prop:'releaseEdition',title:'需求发布版次',width:150},
{prop:'materialCode',title:'零件号'},
{prop:'materialCode',title:'零件号',width:150},
{prop:'materialDescription',title:'零件名称'},
{prop:'plantId',title:'工厂代码'},
{prop:'plantName',title:'工厂名称'},
@ -161,7 +162,7 @@ const apiTableColumns = {
// 日物料需求计划
cherysuppliermrpdata:[
{prop:'releaseEdition',title:'需求发布版次',width:150},
{prop:'materialCode',title:'零件号'},
{prop:'materialCode',title:'零件号',width:150},
{prop:'materialDescription',title:'零件名称'},
{prop:'plantId',title:'工厂代码'},
{prop:'plantName',title:'工厂名称'},
@ -211,7 +212,7 @@ const apiTableColumns = {
{prop:'readState',title:'是否已确认',type:'tagFilter',options:EnumList.whetherBoolean,width:120,noEdit:true},
{prop:'supplierCode',title:'供应商代码',width:120},
{prop:'releaseEdition',title:'需求发布版次',width:150},
{prop:'materialCode',title:'零件号'},
{prop:'materialCode',title:'零件号',width:150},
{prop:'plantId',title:'工厂代码',width:120},
{prop:'feedbackResults',title:'反馈结果',type:'filterSelect',options:EnumList.feedbackResults,required:true,noClear:true},
{prop:'ventureType',title:'风险类型',type:'filterSelect',options:EnumList.ventureType},
@ -254,7 +255,7 @@ const apiTableColumns = {
// 日物料需求计划风险确认-明细
cherysuppliercondateDetail:[
{prop:'releaseEdition',title:'需求发布版次',width:150},
{prop:'materialCode',title:'零件号'},
{prop:'materialCode',title:'零件号',width:150},
{prop:'materialDescription',title:'零件名称'},
{prop:'plantId',title:'工厂代码'},
{prop:'plantName',title:'工厂名称'},
@ -302,7 +303,7 @@ const apiTableColumns = {
cherysuppliersaweek:[
{prop:'scheduleAgreement',title:'计划协议号',width:120},
{prop:'serialNumber',title:'行项目号'},
{prop:'materialCode',title:'零件号'},
{prop:'materialCode',title:'零件号',width:150},
{prop:'materialDescription',title:'零件名称'},
{prop:'purchasingGroup',title:'采购组'},
{prop:'plantId',title:'工厂代码'},
@ -393,7 +394,7 @@ const apiTableColumns = {
{prop:'vin',title:'VIN'},
{prop:'productionLineId',title:'产线代码'},
{prop:'productionLineName',title:'产线名称'},
{prop:'materialCode',title:'物料编码'},
{prop:'materialCode',title:'物料编码',width:150},
{prop:'materialDescription',title:'物料描述'},
{prop:'productionType',title:'报工类型'},
{prop:'onLineTime',title:'上线日期时间',width:180},
@ -410,7 +411,7 @@ const apiTableColumns = {
{prop:'vin',title:'VIN'},
{prop:'productionLineId',title:'产线代码'},
{prop:'productionLineName',title:'产线名称'},
{prop:'materialCode',title:'物料编码'},
{prop:'materialCode',title:'物料编码',width:150},
{prop:'materialDescription',title:'物料描述'},
{prop:'onLineTime',title:'上线日期时间',width:180},
{prop:'finalWorkshop',title:'总装车间'},
@ -432,7 +433,7 @@ const apiTableColumns = {
{prop:'pickUpCrossings',title:'取货道口'},
{prop:'feedback',title:'反馈信息'},
{prop:'plant',title:'工厂'},
{prop:'materialCode',title:'零件号'},
{prop:'materialCode',title:'零件号',width:150},
{prop:'materialDescription',title:'零件名称'},
{prop:'quantityDelivery',title:'数量'},
{prop:'returnType',title:'退货类型',type:'filter',options:EnumList.returnType},
@ -450,7 +451,7 @@ const apiTableColumns = {
supplierinvdata:[
{prop:'plantId',title:'工厂代码'},
{prop:'plantName',title:'工厂名称'},
{prop:'materialCode',title:'零件号'},
{prop:'materialCode',title:'零件号',width:150},
{prop:'materialDescription',title:'零件名称'},
{prop:'quantityCurrent',title:'前库存数量'},
{prop:'stockState',title:'库存状态'},
@ -469,7 +470,7 @@ const apiTableColumns = {
{prop:'supplierCode',title:'供应商代码',required:true},
{prop:'supplierName',title:'供应商名称',required:true},
{prop:'serialNumber',title:'行项目号'},
{prop:'materialCode',title:'零件号',required:true},
{prop:'materialCode',title:'零件号',required:true,width:150},
{prop:'materialDescription',title:'零件名称',required:true},
{prop:'materialType',title:'物料类型',type:'filter',options:EnumList.materialType},
{prop:'quantityCurrent',title:'当前库存数量',type:'number',required:true},
@ -488,7 +489,7 @@ const apiTableColumns = {
{prop:'plantName',title:'工厂名称'},
{prop:'demandSrate',title:'需求状态'},
{prop:'demandType',title:'需求类型'},
{prop:'materialCode',title:'零件号'},
{prop:'materialCode',title:'零件号',width:150},
{prop:'materialDescription',title:'零件名称'},
{prop:'summarySign',title:'集货标识'},
{prop:'dateRequired',title:'需求日期',width:180},
@ -513,7 +514,7 @@ const apiTableColumns = {
// 日MRP预警推移
cherysuppliermrpwarning:[
{prop:'plantId',title:'工厂代码'},
{prop:'materialCode',title:'零件号'},
{prop:'materialCode',title:'零件号',width:150},
{prop:'materialDescription',title:'零件名称'},
{prop:'quantityCurrent',title:'当前库存'},
{prop:'reckonDate',title:'需求日期',width:180},
@ -535,7 +536,7 @@ const apiTableColumns = {
{prop:'deliveryNumber',title:'配送单号'},
{prop:'serialNumber',title:'行项目号'},
{prop:'serialSrate',title:'配送单状态'},
{prop:'materialCode',title:'零件号'},
{prop:'materialCode',title:'零件号',width:150},
{prop:'materialDescription',title:'零件名称'},
{prop:'plantId',title:'工厂代码'},
{prop:'receivingCrossings',title:'收货道口'},
@ -558,7 +559,7 @@ const apiTableColumns = {
{prop:'vin',title:'VIN'},
{prop:'productionLineId',title:'产线代码'},
{prop:'productionLineName',title:'产线名称'},
{prop:'materialCode',title:'物料编码'},
{prop:'materialCode',title:'物料编码',width:150},
{prop:'materialDescription',title:'物料描述'},
{prop:'sortDate',title:'排序日期'},
{prop:'sortTime',title:'排序时间'},
@ -705,7 +706,7 @@ const apiTableColumns = {
{prop:'vendorProductName',title:'供应商父件名称',width:180},
{prop:'vendorProductType',title:'父件类型',type:'filter',options:EnumList.vendorProductType},
{prop:'materialUnit',title:'父件单位'},
{prop:'subMaterialCode',title:'子件编码'},
{prop:'subMaterialCode',title:'子件编码',width:150},
{prop:'subMaterialName',title:'子件名称'},
{prop:'subMaterialType',title:'子件类型',type:'filter',options:EnumList.subMaterialType},
{prop:'subMaterialUnit',title:'子件单位'},

247
Web/src/views/task/components/commonLogPage.vue

@ -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>

219
Web/src/views/task/logisticsPlanLog/index copy 2.vue

@ -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>

246
Web/src/views/task/logisticsPlanLog/index copy.vue

@ -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>

244
Web/src/views/task/logisticsPlanLog/index.vue

@ -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>

155
Web/src/views/task/productionQualityLog/index copy.vue

@ -1,5 +1,5 @@
<template>
<div class="taskSubPage" v-loading="state.loading">
<div class="productionQualityLogPage" v-loading="state.loading">
<!-- 主表 -->
<tablePage
:apiName="state.apiName"
@ -15,6 +15,7 @@
<!-- 明细抽屉 -->
<el-drawer
class="productionQualityLog_infoDrawerPop"
v-if="state.drawerShow"
v-model="state.drawerShow"
:title="`详情 (${state.infoCurrentRow.taskName} - uId:${state.infoCurrentRow.uId})`"
@ -24,21 +25,32 @@
@close="resetInfo"
>
<div style="height: 100%">
<!-- 前端分页 -->
<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 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>
@ -52,7 +64,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'
@ -76,64 +88,72 @@
{label:'下载JSON',name:'downloadJSON',link:true,type:'warning'},
],
//
drawerShow:false,
infoTableData:null,
infoTableColumns:[],
columnWidth:null,
infoType:null,
infoAllData:null,
infoCurrentRow:null,
infoPager:{
drawerShow:false,
infoTableDataTop:null,//
infoTableColumnsTop:null,
infoAllDataTop:null,
infoTopType:null,
infoPagerTop:{
page: 1,
pageSize: 20,
pageSize: 10,
total: null,
},
//
infoTableColumns:[],
// colums
infoTableColumnsName:null,
infoSearchFilter: {},
})
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.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=>{
if(_arr1.indexOf(scope.row.taskName) >= 0){
state.columnWidth = null
state.infoType = 1
state.infoTableData = [JSON.parse(res.message)]
state.infoTableColumns = [
// 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)]
}
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))
.finally(() => {
state.loading = false
state.drawerShow = true
})
}
// json
if(btn.name == 'downloadJSON'){
@ -146,36 +166,35 @@
}
}
// InfoType=2
function initInfoType2Pagedata() {
state.infoTableData = state.infoAllData.slice((state.infoPager.page-1) * state.infoPager.pageSize,state.infoPager.page * state.infoPager.pageSize)
//
function initInfoTopPagedata() {
state.infoTableDataTop = state.infoAllDataTop.slice((state.infoPagerTop.page-1) * state.infoPagerTop.pageSize,state.infoPagerTop.page * state.infoPagerTop.pageSize)
}
function pageSizeChange(data) {
state.infoPager.pageSize = data
state.infoPager.page = 1
state.infoPagerTop.pageSize = data
state.infoPagerTop.page = 1
nextTick(() => {
initInfoType2Pagedata()
initInfoTopPagedata()
})
}
function pageCurrentChange(data) {
state.infoPager.page = data
state.infoPagerTop.page = data
nextTick(() => {
initInfoType2Pagedata()
initInfoTopPagedata()
})
}
function resetInfo(){
state.drawerShow=false
state.infoTableData=null
state.infoTableDataTop=null
state.infoTableColumns=[]
state.columnWidth=null
state.infoType=null
state.infoTableColumnsTop=[]
state.infoAllData=null
state.infoPager={
state.infoPagerTop={
page: 1,
pageSize: 20,
pageSize: 10,
total: null,
}
}
@ -188,7 +207,7 @@
</script>
<style scope lang="scss">
.taskSubPage{
.productionQualityLogPage{
height: 100%;
display: flex;
width:100%;

184
Web/src/views/task/productionQualityLog/index.vue

@ -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…
Cancel
Save