Browse Source

0823更新

master
ruanqi 4 years ago
parent
commit
c11fde8b35
  1. 2
      index.html
  2. 2
      src/api/production/dailyPlan.js
  3. 6
      src/api/production/pallet.js
  4. 32
      src/assets/scss/global.scss
  5. 1
      src/main.js
  6. 2
      src/router/index.js
  7. 5
      src/views/common/login.vue
  8. 210
      src/views/modules/pallet/pallet.vue
  9. 43
      src/views/modules/production/dailyPlan.vue
  10. 254
      src/views/modules/production/resourceCapacityLoading.vue
  11. 4
      static/config/init.js
  12. 18
      static/plugins/echarts-5.3.1/echarts.min.js

2
index.html

@ -13,7 +13,7 @@
<link rel="shortcut icon" type="image/x-icon" href="./static/img/favicon.ico">
<script src="./static/config/index.js"></script>
<script src="./static/plugins/mock-1.0.0-beta3/mock-min.js"></script>
<script src="./static/plugins/echarts-3.8.5/echarts.common.min.js"></script>
<script src="./static/plugins/echarts-5.3.1/echarts.min.js"></script>
<script src="./static/plugins/ueditor-1.4.3.3/ueditor.config.js"></script>
<script src="./static/plugins/ueditor-1.4.3.3/ueditor.all.min.js"></script>
<script src="./static/plugins/ueditor-1.4.3.3/lang/zh-cn/zh-cn.js"></script>

2
src/api/production/dailyPlan.js

@ -27,3 +27,5 @@ export const cancelScheduleData=data => createAPI(`/dailyPlan/cancelScheduleDat
export const rescheduleData=data => createAPI(`/dailyPlan/rescheduleData`,'post',data)
//改变排产顺序
export const changeSoScheduledListSeqNo=data => createAPI(`/dailyPlan/changeSoScheduledListSeqNo`,'post',data)
//机台产能负荷数据
export const resourceCapacityLoadingData=data => createAPI(`/dailyPlan/resourceCapacityLoadingData`,'post',data)

6
src/api/production/pallet.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)

32
src/assets/scss/global.scss

@ -393,3 +393,35 @@ a:hover{
background-color: transparent !important;
}
/* 控制el-card标签的数据*/
div.customer-el-card {
margin-left: 70px;
margin-top: -17px;
height: 20px;
width: 60px;
}
/* 颜色控制 */
div.customer-el-card-pink {
background: #FF00FF;
}
div.customer-el-card-orange {
background: #FFD700;
}
div.customer-el-card-blue {
background: #0000CD;
}
/*针对el-card*/
.customer-card .el-form-item__content{
margin-top: -15px;
}
.customer-card .el-form-item{
height: 22px;
}
.customer-border .el-form-item__content{
margin-top: -30px;
}

1
src/main.js

@ -16,6 +16,7 @@ import i18n from '@/i18n/i18n'
import './directives'
import decimalUtil from '@/utils/decimalUtil.js'
Vue.component('downloadExcel', JsonExcel)

2
src/router/index.js

@ -36,7 +36,7 @@ const mainRoutes = {
// 提示: 如需要通过iframe嵌套展示内容, 但不通过tab打开, 请自行创建组件使用iframe处理!
{ path: '/home', component: _import('common/home'), name: 'home', meta: { title: '首页' } },
{ path: '/theme', component: _import('common/theme'), name: 'theme', meta: { title: '主题' } },
// { path: '/demo-echarts', component: _import('demo/echarts'), name: 'demo-echarts', meta: { title: 'demo-echarts', isTab: true } },
{ path: '/demo-echarts', component: _import('demo/echarts'), name: 'demo-echarts', meta: { title: 'demo-echarts', isTab: true } },
// { path: '/demo-ueditor', component: _import('demo/ueditor'), name: 'demo-ueditor', meta: { title: 'demo-ueditor', isTab: true } }
],
beforeEnter (to, from, next) {

5
src/views/common/login.vue

@ -12,7 +12,7 @@
<el-form-item prop="userName">
<el-input v-model="dataForm.userName" placeholder="帐号"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-form-item prop="password" style="margin-top: 10px">
<el-input v-model="dataForm.password" type="password" placeholder="密码"></el-input>
</el-form-item>
<el-form-item>
@ -62,7 +62,6 @@
'username': this.dataForm.userName,
'password': this.dataForm.password,
'uuid': this.dataForm.uuid
})
}).then(({data}) => {
if (data && data.code === 0) {
@ -71,14 +70,12 @@
localStorage.setItem('locale', data.language)
localStorage.setItem('refresh', "0")
} else {
this.$message.error(data.msg)
}
})
}
})
},
}
}
</script>

210
src/views/modules/pallet/pallet.vue

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

43
src/views/modules/production/dailyPlan.vue

@ -37,13 +37,13 @@
</el-date-picker>
</el-form-item>
<el-form-item label="至">
<el-date-picker
style="width: 120px"
v-model="searchData.date4"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
<el-date-picker
style="width: 120px"
v-model="searchData.date4"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-form>
</fieldset>
@ -64,7 +64,7 @@
<legend>排产信息</legend>
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -2px;" >
<el-form-item label="工厂">
<el-form-item label="工厂编号">
<el-input v-model="searchData.site" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="加工中心">
@ -738,7 +738,7 @@
</el-table-column>
</el-table>
</div>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="changeSeqNo">保存</el-button>
<el-button type="primary" @click="changeModalFlag = false">关闭</el-button>
</el-footer>
@ -1405,30 +1405,5 @@
height: 20px;
width: 60px;
}
/* 颜色控制 */
div.customer-el-card-pink {
background: #FF00FF;
}
div.customer-el-card-orange {
background: #FFD700;
}
div.customer-el-card-blue {
background: #0000CD;
}
/*针对el-card*/
.customer-card .el-form-item__content{
margin-top: -15px;
}
.customer-card .el-form-item{
height: 22px;
}
.customer-border .el-form-item__content{
margin-top: -30px;
}
</style>

254
src/views/modules/production/resourceCapacityLoading.vue

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

4
static/config/init.js

@ -10,7 +10,7 @@
js: [
// 插件, 放置业务之前加载, 以免业务需求依赖插件时, 还未加载出错
// 插件 - echarts
window.SITE_CONFIG.cdnUrl + '/static/plugins/echarts-3.8.5/echarts.common.min.js',
window.SITE_CONFIG.cdnUrl + '/static/plugins/echarts-5.3.1/echarts.min.js',
// 插件 - ueditor
window.SITE_CONFIG.cdnUrl + '/static/plugins/ueditor-1.4.3.3/ueditor.config.js',
window.SITE_CONFIG.cdnUrl + '/static/plugins/ueditor-1.4.3.3/ueditor.all.min.js',
@ -73,4 +73,4 @@
createScripts();
}
};
})();
})();

18
static/plugins/echarts-5.3.1/echarts.min.js
File diff suppressed because it is too large
View File

Loading…
Cancel
Save