Merge branch 'dev-scheduling' of http://42.192.7.176:3000/suojin/jonhon-mes-web into dev-scheduling

dev-scheduling
zhangdi 1 month ago
commit 1fe8b8e90f
  1. 9
      src/api/tankSolutionSystem/resultsCon.js
  2. 186
      src/views/qualityManagement/tankSolutionSystem/workTankLine.vue
  3. 21
      src/views/warehouseManagement/materialMaintenance.vue

@ -89,4 +89,13 @@ export const exportReport = (params) =>{
params,
responseType: 'blob',
})
}
// 曲线详情
export const getLineDetail = (params) =>{
return request({
url:'/api/blade-desk/QA/LiquidTankWave/detail',
method:'get',
params
})
}

@ -19,8 +19,8 @@
<el-form :inline="true" v-model="lineForm" label-width="80px">
<el-row :gutter="24">
<el-col :span="6">
<el-form-item label="作业中心" prop="workCenterId">
<el-select v-model="lineForm.workCenterId" placeholder="请选择" style="width: 200px;">
<el-form-item label="作业中心" prop="wcId">
<el-select v-model="lineForm.wcId" placeholder="请选择" style="width: 200px;">
<el-option v-for="item in workCenterData" :key="item.id" :label="item.wcName"
:value="item.id"></el-option>
</el-select>
@ -46,7 +46,7 @@
<div v-if="isShowBox">
<el-row :gutter="24" id="chartsContainer1">
<el-col :span="12" v-for="(item,index) in lineData" :key="item.id">
<div style="width: 100%;height: 240px;" :id="`chart-${index}`"></div>
<div style="width: 100%;height: 240px;" :id="`chart-${item.id || index}`"></div>
</el-col>
<!-- <el-col :span="12">
<div style="width: 100%;height: 240px;" ref="lineChart2"></div>
@ -77,22 +77,22 @@
<!-- <div style="width: 33%;margin-bottom: 15px;">槽号{{ detailForm.slotNo }}</div>
<div style="width: 33%;margin-bottom: 15px;">检测成分{{ detailForm.testName }}</div> -->
<div style="width: 33%;">曲线时间范围{{ detailForm.lineTime }}</div>
<div style="width: 33%;">操作人{{ detailForm.createTime }}</div>
<div style="width: 33%;">曲线生成时间{{ detailForm.createUser }}</div>
<div style="width: 33%;">操作人{{ detailForm.updateUserRealName }}</div>
<div style="width: 33%;">曲线生成时间{{ detailForm.createTime }}</div>
</div>
</div>
<div style="margin: 20px 0;">
检测曲线
</div>
<div id="chartsContainer1">
<div style="width: 100%;height: 240px;" v-for="(item,index) in lineData" :key="item.id" :id="`chart-${index}`"></div>
<div id="chartsContainer1" style="">
<div style="width: 100%;height: 240px;margin-top:30px;" v-for="(item,index) in lineData" :key="item.id" :id="`chart-${item.id || index}`"></div>
</div>
</el-dialog>
</div>
</template>
<script>
import {createLineList,generateLine,getLineList,deleteLine} from '@/api/tankSolutionSystem/resultsCon'
import {createLineList,generateLine,getLineList,deleteLine,getLineDetail} from '@/api/tankSolutionSystem/resultsCon'
import {getWorkCenter} from '@/api/tankSolutionSystem/info'
import { detail } from '@/api/flow/flow'
import { exportEchartsToPdf } from '@/utils/exportPdf'; //
@ -248,49 +248,13 @@ export default {
},
createLine(){
createLineList({
workCenterId:this.lineForm.workCenterId,
createTimeStart:this.lineForm.timeRange && this.lineForm.timeRange.length != 0 ? this.lineForm.timeRange[0] : '',
createTimeEnd:this.lineForm.timeRange && this.lineForm.timeRange.length != 0 ? this.lineForm.timeRange[1] : '',
workCenterId:this.lineForm.wcId,
createTimeStart:this.lineForm.timeRange && this.lineForm.timeRange.length != 0 && this.lineForm.timeRange[0] ,
createTimeEnd:this.lineForm.timeRange && this.lineForm.timeRange.length != 0 && this.lineForm.timeRange[1] ,
}).then(res =>{
console.log('res--------------',res)
this.isShowBox = true
this.lineData = res.data.data.waveData
// this.wareData = res.data.data.records
// this.lineData = [
// {
// workCenterId:"001",
// workCenterName:"A",
// workTankId:"002",
// workTankName:"A",
// testElement:"A",
// date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',],
// max:['10','10','10','10','10','10',],//10
// min: ['5','5','5','5','5','5',],
// targrt:['6','3','2','1','10','15',]
// },
// {
// workCenterId:"001",
// workCenterName:"A",
// workTankId:"002",
// workTankName:"A",
// testElement:"B",
// date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',],
// max:['10','10','10','10','10','10',],//10
// min: ['5','5','5','5','5','5',],
// targrt:['6','3','2','1','10','15',]
// },
// {
// workCenterId:"001",
// workCenterName:"A",
// workTankId:"003",
// workTankName:"B",
// testElement:"C",
// date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',],
// max:['10','10','10','10','10','10',],//10
// min: ['5','5','5','5','5','5',],
// targrt:['6','3','2','1','10','15',]
// }
// ]
this.$nextTick(() =>{
this.createChart()
})
@ -298,12 +262,26 @@ export default {
},
createChart(){
console.log('this.lineData',this.lineData)
let globalMax = -Infinity; //
this.lineData.forEach((item, index) => {
if (item.maxList && item.maxList.length > 0) {
// max
const currentMax = Math.max(...item.maxList);
//
if (currentMax > globalMax) {
globalMax = currentMax;
}
}
console.log('item-----------',item)
const chartId = `chart-${item.id || index}`;
const chartDom = document.getElementById(chartId);
console.log('chartDom----------',chartDom)
if (!chartDom) return;
// ECharts
const chart = this.$echarts.init(chartDom);
console.log('chart----------',chart)
const option = {
title: {
@ -312,8 +290,8 @@ export default {
},
legend: {
show: true,
orient: "vertical",
right: 'right'
orient: "horizontal",
right: '0'
},
grid: {
containLabel: true,
@ -350,7 +328,7 @@ export default {
color: '#000',
fontSize: 14
},
max: parseInt(item.maxList[0]) + 10,
// max: globalMax + 10,
axisTick: {
show: false
},
@ -414,14 +392,21 @@ export default {
submit(){
const submitParams = this.lineData.map(item =>{
item.workCenterId = item.wcId
const {wcId,...submitData} = item
const {...submitData} = item
return submitData
})
console.log('submitParams---------',submitParams)
generateLine(submitParams).then(res =>{
let params = {
wcId:this.lineForm.wcId,
createTimeStart:this.lineForm.timeRange && this.lineForm.timeRange.length != 0 && this.lineForm.timeRange[0],
createTimeEnd:this.lineForm.timeRange && this.lineForm.timeRange.length != 0 && this.lineForm.timeRange[1],
copys:submitParams
}
generateLine(params).then(res =>{
if(res.data.code == 200){
this.$message.success('生成曲线成功')
this.lineBox = false
this.lineData = []
this.onLoad()
}
})
@ -498,51 +483,62 @@ export default {
done();
},
handleView(row) {
this.detailForm = {
workCenterName:'作业中心B',
lineTime:'2025-12-01~2025-12-19',
createTime:"111",
createUser:"2025-12-19"
}
this.lineData = [
{
workCenterId:"001",
workCenterName:"作业中心A",
workTankId:"002",
workTankName:"作业槽A",
testElement:"分析项目A",
date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',],
max:['10','10','10','10','10','10',],//10
min: ['5','5','5','5','5','5',],
targrt:['6','3','2','1','10','15',]
},
{
workCenterId:"001",
workCenterName:"作业中心A",
workTankId:"002",
workTankName:"作业槽A",
testElement:"分析项目B",
date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',],
max:['10','10','10','10','10','10',],//10
min: ['5','5','5','5','5','5',],
targrt:['6','3','2','1','10','15',]
},
{
workCenterId:"001",
workCenterName:"作业中心A",
workTankId:"003",
workTankName:"作业槽B",
testElement:"分析项目C",
date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',],
max:['10','10','10','10','10','10',],//10
min: ['5','5','5','5','5','5',],
targrt:['6','3','2','1','10','15',]
}
]
getLineDetail({
id:row.id
}).then(res =>{
console.log('res-----------',res)
this.detailForm = res.data.data
this.lineData = res.data.data.taskCopys
this.detailBox = true
this.$nextTick(() =>{
this.createChart()
})
})
// this.detailForm = {
// workCenterName:'B',
// lineTime:'2025-12-01~2025-12-19',
// createTime:"111",
// createUser:"2025-12-19"
// }
// this.lineData = [
// {
// workCenterId:"001",
// workCenterName:"A",
// workTankId:"002",
// workTankName:"A",
// testElement:"A",
// date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',],
// max:['10','10','10','10','10','10',],//10
// min: ['5','5','5','5','5','5',],
// targrt:['6','3','2','1','10','15',]
// },
// {
// workCenterId:"001",
// workCenterName:"A",
// workTankId:"002",
// workTankName:"A",
// testElement:"B",
// date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',],
// max:['10','10','10','10','10','10',],//10
// min: ['5','5','5','5','5','5',],
// targrt:['6','3','2','1','10','15',]
// },
// {
// workCenterId:"001",
// workCenterName:"A",
// workTankId:"003",
// workTankName:"B",
// testElement:"C",
// date:['2025-12-05','2025-12-06','2025-12-07','2025-12-08','2025-12-09','2025-12-10',],
// max:['10','10','10','10','10','10',],//10
// min: ['5','5','5','5','5','5',],
// targrt:['6','3','2','1','10','15',]
// }
// ]
// this.detailBox = true
// this.$nextTick(() =>{
// this.createChart()
// })
// console.log('row-------------------', row)
// this.detailForm = row
// let data = row.lineTime.split(' ~ ')
@ -759,8 +755,8 @@ export default {
current:this.page.currentPage,
size:this.page.pageSize,
name:this.query.name,
createTimeStart:this.query.createTime && this.query.createTime.length != 0 ? this.query.createTime[0] : '',
createTimeEnd:this.query.createTime && this.query.createTime.length != 0 ? this.query.createTime[1] : '',
createTimeStart:this.query.createTime && this.query.createTime.length != 0 && this.query.createTime[0],
createTimeEnd:this.query.createTime && this.query.createTime.length != 0 && this.query.createTime[1],
}).then(res =>{
this.data = res.data.data.records
this.page.total = res.data.data.total

@ -247,10 +247,15 @@ export default {
if(val.value == 2){
let tmp = this.option.column.find(item => item.prop == 'minNum')
tmp.rules[0].required = true
}else{
let tmp = this.option.column.find(item => item.prop == 'minNum')
tmp.rules[0].required = false
}
}else{
let tmp = this.option.column.find(item => item.prop == 'gcId')
tmp.rules[0].required = false
let tmp1 = this.option.column.find(item => item.prop == 'minNum')
tmp1.rules[0].required = false
}
}
},
@ -502,6 +507,22 @@ export default {
this.form.minWarning = this.form.minWarning != '' ? this.form.minWarning : false
this.form.reissueType = (this.form.reissueType && this.form.reissueType != -1) ? this.form.reissueType : 0
this.form.gcId = this.form.gcId == -1 ? '' : this.form.gcId
if(this.form.reissueType != 0){
let tmp = this.option.column.find(item => item.prop == 'gcId')
tmp.rules[0].required = true
if(this.form.reissueType == 2){
let tmp = this.option.column.find(item => item.prop == 'minNum')
tmp.rules[0].required = true
}else{
let tmp = this.option.column.find(item => item.prop == 'minNum')
tmp.rules[0].required = false
}
}else{
let tmp = this.option.column.find(item => item.prop == 'gcId')
tmp.rules[0].required = false
let tmp1 = this.option.column.find(item => item.prop == 'minNum')
tmp1.rules[0].required = false
}
done()
}else{
done()

Loading…
Cancel
Save