12 changed files with 537 additions and 42 deletions
-
2index.html
-
2src/api/production/dailyPlan.js
-
6src/api/production/pallet.js
-
32src/assets/scss/global.scss
-
1src/main.js
-
2src/router/index.js
-
5src/views/common/login.vue
-
210src/views/modules/pallet/pallet.vue
-
43src/views/modules/production/dailyPlan.vue
-
254src/views/modules/production/resourceCapacityLoading.vue
-
4static/config/init.js
-
18static/plugins/echarts-5.3.1/echarts.min.js
@ -0,0 +1,6 @@ |
|||
import { createAPI } from "@/utils/httpRequest.js"; |
|||
|
|||
//获取栈板数据
|
|||
export const getPalletData=data => createAPI(`/pallet/getPalletData`,'post',data) |
|||
//保存栈板数据
|
|||
export const savePallet=data => createAPI(`/pallet/savePallet`,'post',data) |
|||
@ -0,0 +1,210 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 3px;margin-left: 2px" > |
|||
<el-form-item label="栈板编码"> |
|||
<el-input v-model="searchData.palletNo" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="是否可用"> |
|||
<el-select filterable v-model="searchData.status" style="width: 120px"> |
|||
<el-option label="是" value="('空置','已装货')"></el-option> |
|||
<el-option label="否" value="('已出库','报废')"></el-option> |
|||
<el-option label="全部" value=""></el-option> |
|||
</el-select> |
|||
<el-button type="primary" @click="getPalletData()">查询</el-button> |
|||
<el-button type="primary" @click="newPallet()">新增</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table |
|||
:height="height" |
|||
:data="palletList" |
|||
border |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
prop="" |
|||
header-align="center" |
|||
align="center" |
|||
width="120" |
|||
label="操作"> |
|||
<template slot-scope="scope" class="foo_container"> |
|||
<a type="text" size="small" @click="editModal(scope.row)">编辑</a> |
|||
<a type="text" size="small" @click="scheduledModal(scope.row)">打印标签</a> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="palletNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="栈板编码"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="palletDesc" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="栈板名称"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="status" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="状态"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="area" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="所属区域"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="currentLocation" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="当前位置"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="createdDate" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="录入日期"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="createdBy" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="录入人"> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-dialog title="维护栈板" :close-on-click-modal="false" v-drag :visible.sync="palletModalFlag" width="300px"> |
|||
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="栈板编码"> |
|||
<el-input v-model="palletData.palletNo" :disabled="palletInputFlag" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="栈板名称"> |
|||
<el-input v-model="palletData.palletDesc" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="栈板状态"> |
|||
<el-select filterable v-model="palletData.status" :disabled="palletSelectFlag" style="width: 120px"> |
|||
<el-option label="空置" value="空置"></el-option> |
|||
<el-option label="已装货" value="已装货"></el-option> |
|||
<el-option label="已出库" value="已出库"></el-option> |
|||
<el-option label="报废" value="报废"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="区域"> |
|||
<el-input v-model="palletData.area" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|||
<el-button type="primary" @click="savePallet">保存</el-button> |
|||
<el-button type="primary" @click="palletModalFlag = false">关闭</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import {savePallet, |
|||
getPalletData, |
|||
} from '@/api/production/pallet.js' |
|||
|
|||
export default { |
|||
name: "pallet", |
|||
data() { |
|||
return { |
|||
height: 200, |
|||
searchData:{ |
|||
palletNo:'', |
|||
status:"('空置','已装货')", |
|||
}, |
|||
palletData:{ |
|||
palletNo:'', |
|||
palletDesc:'', |
|||
status:'', |
|||
id:'', |
|||
site:'', |
|||
area:'', |
|||
createdBy:'', |
|||
updateBy:'', |
|||
}, |
|||
palletList:[], |
|||
palletSelectFlag:false, |
|||
palletInputFlag:false, |
|||
palletModalFlag:false, |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.height = window.innerHeight - 240; |
|||
}) |
|||
}, |
|||
methods: { |
|||
newPallet(){ |
|||
this.palletData.palletNo=''; |
|||
this.palletData.palletDesc=''; |
|||
this.palletData.status='空置'; |
|||
this.palletData.id=0; |
|||
this.palletData.site=this.$store.state.user.site; |
|||
this.palletData.area=''; |
|||
this.palletData.createdBy=this.$store.state.user.name; |
|||
this.palletSelectFlag=true; |
|||
this.palletInputFlag=false; |
|||
this.palletModalFlag=true; |
|||
}, |
|||
editModal(row){ |
|||
this.palletData.palletNo=row.palletNo; |
|||
this.palletData.palletDesc=row.palletDesc; |
|||
this.palletData.status=row.status; |
|||
this.palletData.id=row.id; |
|||
this.palletData.site=this.$store.state.user.site; |
|||
this.palletData.updateBy=this.$store.state.user.name; |
|||
this.palletData.area=row.area; |
|||
this.palletSelectFlag=false; |
|||
this.palletInputFlag=true; |
|||
this.palletModalFlag=true; |
|||
}, |
|||
savePallet(){ |
|||
savePallet(this.palletData).then(({data}) => { |
|||
if(data.code===0){ |
|||
this.getPalletData(); |
|||
this.palletModalFlag=false; |
|||
this.$message({ |
|||
message: '保存成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
onClose: () => { |
|||
} |
|||
}) |
|||
}else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
getPalletData(){ |
|||
getPalletData(this.searchData).then(({data}) => { |
|||
if(data.code===0){ |
|||
this.palletList=data.rows; |
|||
}else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
}, |
|||
created() { |
|||
this.getPalletData(); |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,254 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;"> |
|||
<el-form-item label="工厂编号:"> |
|||
<el-input v-model="searchData.site" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item > |
|||
<span slot="label" style="" @click="getBaseList(88,1)"><a herf="#">机台编号:</a></span> |
|||
<el-input v-model="searchData.resourceID" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="日期"> |
|||
<el-date-picker |
|||
style="width: 120px" |
|||
v-model="searchData.date1" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="至"> |
|||
<el-date-picker |
|||
style="width: 120px" |
|||
v-model="searchData.date2" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
<el-button type="primary" @click="refreshData()">查询</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<!-- <el-form :inline="true" label-position="top" style="margin-left: 28%;margin-top: 20px;">--> |
|||
<!-- <el-form-item label=" ">--> |
|||
<!-- <el-card class="customer-el-card customer-el-card-blue"></el-card>--> |
|||
<!-- </el-form-item>--> |
|||
<!-- <el-form-item :label="'当日产能'">--> |
|||
<!-- <el-card class="customer-el-card customer-el-card-pink"></el-card>--> |
|||
<!-- </el-form-item>--> |
|||
<!-- <el-form-item :label="'未排产负荷'">--> |
|||
<!-- <el-card class="customer-el-card customer-el-card-orange"></el-card>--> |
|||
<!-- </el-form-item>--> |
|||
<!-- <el-form-item :label="'已排产负荷'">--> |
|||
<!-- </el-form-item>--> |
|||
<!-- </el-form>--> |
|||
<div id="main" style="width: 100%;height: 500px;margin-top: 50px"></div> |
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import echarts from 'echarts' |
|||
import { |
|||
resourceCapacityLoadingData, |
|||
} from '@/api/production/dailyPlan.js' |
|||
import Chooselist from '@/views/modules/common/Chooselist' |
|||
|
|||
export default { |
|||
name: 'resourceCapacityLoading', |
|||
components: { |
|||
Chooselist |
|||
}, |
|||
data () { |
|||
return { |
|||
option:null, |
|||
tagNo:'', |
|||
tagNo2:'', |
|||
height:100, |
|||
searchData:{ |
|||
site:this.$store.state.user.site, |
|||
resourceID:'', |
|||
date1:new Date(), |
|||
date2:'', |
|||
}, |
|||
} |
|||
}, |
|||
mounted (){ |
|||
this.$nextTick(() => { |
|||
this.height = window.innerHeight - 250 |
|||
}) |
|||
}, |
|||
methods: { |
|||
getBaseData(val){ |
|||
if (this.tagNo === 88){ |
|||
if(this.tagNo2===1) { |
|||
this.searchData.resourceID = val.ResourceID |
|||
} |
|||
} |
|||
}, |
|||
getBaseList(val,val2){ |
|||
this.tagNo = val |
|||
this.tagNo2 = val2 |
|||
this.$nextTick(() => { |
|||
let strVal = ""; |
|||
if (val === 88){ |
|||
if(val2===1) { |
|||
strVal = this.searchData.resourceID |
|||
} |
|||
} |
|||
|
|||
this.$refs.baseList.init(val,strVal) |
|||
}) |
|||
}, |
|||
refreshData(){ |
|||
if(this.searchData.site==""||this.searchData.site==null){ |
|||
this.$alert('请输入工厂编号!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(this.searchData.resourceID==""||this.searchData.resourceID==null){ |
|||
this.$alert('请输入或者选择机台编号!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(this.searchData.date1==""){ |
|||
this.$alert('请选择开始日期!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(this.searchData.date2==""){ |
|||
this.$alert('请选择结束日期!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(this.dayjs(this.searchData.date2).diff(this.dayjs(this.searchData.date1),'day')>13){ |
|||
this.$alert('时间间隔不能超过14天!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
resourceCapacityLoadingData(this.searchData).then(({data})=>{ |
|||
if(data.total>0){ |
|||
document.getElementById('main').style.height=this.height+"px"; |
|||
if(this.option!=null){ |
|||
document.getElementById('main').removeAttribute('_echarts_instance_') |
|||
this.option = null |
|||
} |
|||
let chartDom = document.getElementById('main'); |
|||
let myChart = echarts.init(chartDom); |
|||
|
|||
let xAxisData=[]; |
|||
let seriesData1=[]; |
|||
let seriesData2=[]; |
|||
let seriesData3=[]; |
|||
|
|||
for (let i = 0; i <data.total ; i++) { |
|||
xAxisData.push(data.rows[i].planDate) |
|||
seriesData1.push(data.rows[i].workTime) |
|||
seriesData2.push(data.rows[i].time1) |
|||
seriesData3.push(data.rows[i].time2) |
|||
} |
|||
xAxisData=JSON.parse(JSON.stringify(xAxisData)) |
|||
seriesData1=JSON.parse(JSON.stringify(seriesData1)) |
|||
seriesData2=JSON.parse(JSON.stringify(seriesData2)) |
|||
seriesData3=JSON.parse(JSON.stringify(seriesData3)) |
|||
this.option = { |
|||
tooltip: { |
|||
trigger: 'axis', |
|||
axisPointer: { |
|||
type: 'shadow' |
|||
} |
|||
}, |
|||
// color:["#1d3195", "#30f105", "#d5ef28"], |
|||
legend: { |
|||
left: "3%", |
|||
itemWidth:35, |
|||
itemHeight:13, |
|||
textStyle: { //图例文字的样式 |
|||
// color: '#fff', |
|||
fontSize: 12 |
|||
}, |
|||
}, |
|||
|
|||
grid: { |
|||
left: '3%', |
|||
right: '4%', |
|||
bottom: '3%', |
|||
containLabel: true |
|||
}, |
|||
xAxis: [ |
|||
{ |
|||
type: 'category', |
|||
data: xAxisData |
|||
// data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'] |
|||
} |
|||
], |
|||
yAxis: [ |
|||
{ |
|||
type: 'value' |
|||
} |
|||
], |
|||
series: [ |
|||
{ |
|||
name: '当日产能', |
|||
type: 'bar', |
|||
emphasis: { |
|||
focus: 'series' |
|||
}, |
|||
data: seriesData1 |
|||
// data: [320, 332, 301, 334, 390, 330, 320] |
|||
}, |
|||
{ |
|||
name: '已排产负荷', |
|||
type: 'bar', |
|||
stack: 'Ad', |
|||
emphasis: { |
|||
focus: 'series' |
|||
}, |
|||
data: seriesData2 |
|||
// data: [120, 132, 101, 134, 90, 230, 210] |
|||
}, |
|||
{ |
|||
name: '未排产负荷', |
|||
type: 'bar', |
|||
stack: 'Ad', |
|||
emphasis: { |
|||
focus: 'series' |
|||
}, |
|||
// data: [220, 182, 191, 234, 290, 330, 310] |
|||
data: seriesData3 |
|||
} |
|||
|
|||
] |
|||
}; |
|||
if(this.option && typeof this.option === 'object') { |
|||
myChart.setOption(this.option); |
|||
// window.addEventListener('resize', () => { |
|||
// this.chartLine.resize({ |
|||
// height:this.height |
|||
// }) |
|||
// }) |
|||
} |
|||
}else { |
|||
this.$alert('该机台不存在!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
|
|||
}) |
|||
}, |
|||
|
|||
|
|||
}, |
|||
created () { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
18
static/plugins/echarts-5.3.1/echarts.min.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue