2023.10.30提测能源&班组
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-drawer title="查看详情" :visible.sync="visible" size="70%">
|
||||
<div class="box">
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getByScheduling } from '@/api/monitoring/groupTeamView'
|
||||
export default {
|
||||
name: 'schedulingMonitoringDetail',
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
tableProps: [],
|
||||
tableData: [],
|
||||
tableH: this.tableHeight(200)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(200)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.visible = true
|
||||
console.log(id)
|
||||
getByScheduling({id}).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.box {
|
||||
padding: 0 32px;
|
||||
}
|
||||
</style>
|
||||
@@ -64,14 +64,12 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
init(params) {
|
||||
console.log(params)
|
||||
this.visible = true
|
||||
this.queryParams = params
|
||||
getByTeam({
|
||||
teamId: this.queryParams.teamId,
|
||||
workOrderId: this.queryParams.workOrderId
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
this.tableData = res.data || []
|
||||
})
|
||||
}
|
||||
|
||||
@@ -61,10 +61,11 @@ export default {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '工单名称',
|
||||
placeholder: '工单名称',
|
||||
param: 'cnName'
|
||||
type: 'select',
|
||||
label: '工单',
|
||||
selectOptions: [],
|
||||
param: 'workOrderId',
|
||||
clearable: false
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -79,7 +80,8 @@ export default {
|
||||
pageSize: 1000,
|
||||
workOrderId: ''
|
||||
},
|
||||
workOrderName: '工单名称ddd',
|
||||
workOrderList: [],
|
||||
workOrderName: '',
|
||||
tableBtn,
|
||||
tableProps,
|
||||
tableH: this.tableHeight(220),
|
||||
@@ -92,33 +94,42 @@ export default {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(220)
|
||||
})
|
||||
this.getOrderList()
|
||||
},
|
||||
methods: {
|
||||
// 获取工单list
|
||||
getOrderList() {
|
||||
workOrderList().then(res => {
|
||||
|
||||
console.log(res)
|
||||
this.formConfig[0].selectOptions = res.data || []
|
||||
this.workOrderList = res.data || []
|
||||
})
|
||||
},
|
||||
// 查询
|
||||
buttonClick(val) {
|
||||
// this.queryParams.workOrderId = val.id
|
||||
this.queryParams.workOrderId = 1
|
||||
if (!val.workOrderId) {
|
||||
this.$modal.msgWarning('工单不能为空')
|
||||
return false
|
||||
}
|
||||
this.queryParams.workOrderId = val.workOrderId
|
||||
this.getList()
|
||||
},
|
||||
// 获取table数据
|
||||
getList() {
|
||||
getByWorkOrder({ id: this.queryParams.workOrderId }).then(res => {
|
||||
console.log(res)
|
||||
this.list = res.data
|
||||
this.list = res.data || []
|
||||
})
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val)
|
||||
this.paramVisible = true
|
||||
let params = {}
|
||||
params.teamId = val.data.id
|
||||
params.teamName = val.data.name
|
||||
this.workOrderList.map(item => {
|
||||
if (this.queryParams.workOrderId === item.id) {
|
||||
this.workOrderName = item.name
|
||||
}
|
||||
})
|
||||
params.workOrderId = this.queryParams.workOrderId
|
||||
params.workOrderName = this.workOrderName
|
||||
this.$nextTick(() => {
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-drawer title="查看详情" :visible.sync="visible" size="70%" :wrapperClosable='false' @closed="closeDrawer">
|
||||
<div class="box">
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getByScheduling } from '@/api/monitoring/groupTeamView'
|
||||
import { getSchedulingMonitoringRecord } from '@/api/monitoring/teamProduction'
|
||||
export default {
|
||||
name: 'TeamProductionDetail',
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
tableProps: [
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线',
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
prop: 'startTime',
|
||||
label: '上班时间',
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
prop: 'endTime',
|
||||
label: '下班时间',
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
prop: 'workOrderList',
|
||||
label: '生产工单'
|
||||
}
|
||||
],
|
||||
tableData: [],
|
||||
tableH: this.tableHeight(200)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(200)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
init(params) {
|
||||
this.visible = true
|
||||
// console.log(params)
|
||||
getByScheduling({id:params.id}).then(res => {
|
||||
let dataList1 = []
|
||||
let dataList2 = []
|
||||
if (res.data.nameData && res.data.nameData.length > 0) {
|
||||
dataList1 = res.data
|
||||
// 下一个接口的参数&&表头
|
||||
let timeArr = []
|
||||
res.data.nameData.map(item => {
|
||||
let tablePropsObj = {
|
||||
prop: '',
|
||||
label: '',
|
||||
children: [
|
||||
{
|
||||
prop: '',
|
||||
label: '上片数据'
|
||||
},
|
||||
{
|
||||
prop: '',
|
||||
label: '下片数据'
|
||||
},
|
||||
{
|
||||
prop: '',
|
||||
label: '良品面积'
|
||||
},
|
||||
{
|
||||
prop: '',
|
||||
label: '报废数据'
|
||||
},
|
||||
{
|
||||
prop: '',
|
||||
label: '报废比例'
|
||||
}
|
||||
]
|
||||
}
|
||||
timeArr.push(this.parseTime(item.name))
|
||||
tablePropsObj.prop = item.name
|
||||
tablePropsObj.label = this.parseTime(item.name)
|
||||
tablePropsObj.children[0].prop = item.name+'sumInput'
|
||||
tablePropsObj.children[1].prop = item.name+'sumOutput'
|
||||
tablePropsObj.children[2].prop = item.name+'goodArea'
|
||||
tablePropsObj.children[3].prop = item.name+'dynamicValue'
|
||||
tablePropsObj.children[4].prop = item.name+'dynamicRatio'
|
||||
this.tableProps.push(tablePropsObj)
|
||||
})
|
||||
getSchedulingMonitoringRecord({
|
||||
checkTime: timeArr
|
||||
}).then(result => {
|
||||
dataList2 = result.data
|
||||
// console.log(dataList1)
|
||||
// console.log(dataList2)
|
||||
for (let i = 0; i < dataList1.data.length; i++) {
|
||||
let obj = {}
|
||||
obj.lineName = dataList1.data[i].lineName
|
||||
obj.startTime = this.parseTime(params.startTime)
|
||||
obj.endTime = this.parseTime(params.endTime)
|
||||
obj.workOrderList = dataList1.data[i].workOrderList
|
||||
let subData1 = dataList1.data[i].data
|
||||
for (let ii = 0; ii < subData1.length; ii++) {
|
||||
obj[subData1[ii].dynamicName+'sumInput'] = subData1[ii].dynamicValue.sumInput
|
||||
obj[subData1[ii].dynamicName+'sumOutput'] = subData1[ii].dynamicValue.sumOutput
|
||||
obj[subData1[ii].dynamicName+'goodArea'] = subData1[ii].dynamicValue.goodArea
|
||||
}
|
||||
for (let j = 0; j < dataList2.data.length; j++) {
|
||||
let subData2 = dataList2.data[j].data
|
||||
for (let jj = 0; jj < subData2.length; jj++) {
|
||||
obj[subData2[jj].dynamicName+'dynamicValue'] = subData2[jj].dynamicValue
|
||||
obj[subData2[jj].dynamicName+'dynamicRatio'] = obj[subData2[jj].dynamicName+'dynamicValue'] / obj[subData2[jj].dynamicName+'sumOutput']
|
||||
}
|
||||
}
|
||||
this.tableData.push(obj)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
closeDrawer() {
|
||||
this.tableData = []
|
||||
this.tableProps = [
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线',
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
prop: 'startTime',
|
||||
label: '上班时间',
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
prop: 'endTime',
|
||||
label: '下班时间',
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
prop: 'workOrderList',
|
||||
label: '生产工单'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.box {
|
||||
padding: 0 32px;
|
||||
}
|
||||
</style>
|
||||
@@ -30,13 +30,13 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
<!-- 查看生产情况 -->
|
||||
<scheduling-monitoring-detail v-if='paramVisible' ref='schedulingMonitoringDetail'/>
|
||||
<team-production-detail v-if='paramVisible' ref='schedulingMonitoringDetail'/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { groupTeamSchedulingPage } from '@/api/base/groupTeamScheduling'
|
||||
import { groupTeamSchedulingPage } from '@/api/monitoring/teamProduction'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import SchedulingMonitoringDetail from './components/schedulingMonitoringDetail'
|
||||
import TeamProductionDetail from './components/teamProductionDetail'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
@@ -122,7 +122,7 @@ export default {
|
||||
paramVisible: false
|
||||
}
|
||||
},
|
||||
components: { SchedulingMonitoringDetail },
|
||||
components: { TeamProductionDetail },
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(220)
|
||||
@@ -141,12 +141,15 @@ export default {
|
||||
this.list = res.data.list || []
|
||||
this.total = res.data.total || 0
|
||||
})
|
||||
},
|
||||
getGroupClass() {
|
||||
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val)
|
||||
this.paramVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.schedulingMonitoringDetail.init(val.data.id)
|
||||
this.$refs.schedulingMonitoringDetail.init(val.data)
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user