Browse Source

主生产计划添加分页

pull/155/head
xuxiaoming 3 years ago
parent
commit
db4d1c4127
9 changed files with 751 additions and 733 deletions
  1. +2
    -2
      src/server/request.js
  2. +1
    -2
      src/store/productionPlanning/customerForecastDemandReview.js
  3. +55
    -56
      src/utils/dragChangeSize.js
  4. +2
    -2
      src/views/factoryModel/customer/addOrEdit.vue
  5. +0
    -1
      src/views/factoryModel/customer/index.vue
  6. +584
    -561
      src/views/productionPlanning/customerForecastDemandReview/demandPlanning/articleDemand/index.vue
  7. +4
    -8
      src/views/productionPlanning/customerForecastDemandReview/demandPlanning/index.vue
  8. +1
    -1
      src/views/productionPlanning/customerForecastDemandReview/index.vue
  9. +102
    -100
      src/views/productionPlanning/customerForecastDemandReview/resourceContent/evaluation/index.vue

+ 2
- 2
src/server/request.js View File

@ -2,8 +2,8 @@ import axios from "axios";
import { ElMessage } from "element-plus";
let switchValue = true;
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_URL || "http://101.201.121.115:9003/",
// baseURL: process.env.VUE_APP_BASE_URL || "http://192.168.0.36:9003/",
//baseURL: process.env.VUE_APP_BASE_URL || "http://101.201.121.115:9003/",
baseURL: process.env.VUE_APP_BASE_URL || "http://192.168.0.36:9003/",
timeout: 1000 * 60 * 2, // request timeout
});
service.interceptors.request.use(


+ 1
- 2
src/store/productionPlanning/customerForecastDemandReview.js View File

@ -65,7 +65,7 @@ const customerForecastDemandReview = {
evaluationLoadPercent: 0,
evaluationLoadInterval: {}
evaluationLoadInterval: {},
},
mutations: {
// 初始化所有数据
@ -235,7 +235,6 @@ const customerForecastDemandReview = {
load++
state.evaluationLoadPercent = parseInt(load / temp * 100)
}, 1000)
} else {
state.evaluationLoadPercent = 100
clearInterval(state.evaluationLoadInterval)


+ 55
- 56
src/utils/dragChangeSize.js View File

@ -1,59 +1,58 @@
// 托在改变文字大小
// 上下拖拽改变窗口大小
export function dragChangeSize(
onmouseupCallback = ()=>{}, // 停止拖拽回调函数
config = {
minTopValue:50, // 顶部最小高度
minBottomValue:50, // 底部最小高度
barHeight:35 // 拖拽条高度
},
dragBarId = 'resize', // 拖拽条ID
boxId = 'box', // 父控件ID
TopId = 'top', // 上部divID
BottomId = 'bottom' // 下部divID
){
// 获得滚动条对象
let resize = document.getElementById(dragBarId);
// 获得容器对象
let box = document.getElementById(boxId);
// 移动长度
let moveLen = 0
// 鼠标按下事件
resize.onmousedown = event => {
// 获得鼠标按下后Y轴坐标
let startY = event.clientY
// 设置拖拽条距离顶部位置
resize.top = resize.offsetTop
// 鼠标移动事件
document.onmousemove = e => {
// 获得移动长度
moveLen = resize.top +(e.clientY - startY)
// 距离顶部最大长度
let maxT = box.clientHeight - resize.offsetHeight
// 限制顶部最小高度
if(moveLen < config.minTopValue) moveLen = config.minTopValue
// 限制底部最小高度
if(moveLen > maxT - config.minBottomValue) moveLen = maxT - config.minBottomValue
// 设置拖拽条高度
resize.style.top = moveLen
// 设置上部div高度
document.getElementById(TopId).style.height = moveLen + "px"
// 设置下部div高度
document.getElementById(BottomId).style.height = (box.clientHeight - moveLen - config.barHeight) + "px"
}
// 鼠标停止事件
document.onmouseup = () => {
// 事件初始化
document.onmousemove = null
document.onmouseup = null
// 释放拖捕获鼠标
resize.releaseCapture && resize.releaseCapture()
// 回调函数
onmouseupCallback(moveLen,box.clientHeight - moveLen - config.barHeight)
}
// 捕获鼠标
resize.setCapture && resize.setCapture()
return false
onmouseupCallback = () => {}, // 停止拖拽回调函数
config = {
minTopValue: 50, // 顶部最小高度
minBottomValue: 50, // 底部最小高度
barHeight: 35 // 拖拽条高度
},
dragBarId = 'resize', // 拖拽条ID
boxId = 'box', // 父控件ID
TopId = 'top', // 上部divID
BottomId = 'bottom' // 下部divID
) {
// 获得滚动条对象
let resize = document.getElementById(dragBarId);
// 获得容器对象
let box = document.getElementById(boxId);
// 移动长度
let moveLen = 0
// 鼠标按下事件
resize.onmousedown = event => {
// 获得鼠标按下后Y轴坐标
let startY = event.clientY
// 设置拖拽条距离顶部位置
resize.top = resize.offsetTop
// 鼠标移动事件
document.onmousemove = e => {
// 获得移动长度
moveLen = resize.top + (e.clientY - startY)
// 距离顶部最大长度
let maxT = box.clientHeight - resize.offsetHeight
// 限制顶部最小高度
if (moveLen < config.minTopValue) moveLen = config.minTopValue
// 限制底部最小高度
if (moveLen > maxT - config.minBottomValue) moveLen = maxT - config.minBottomValue
// 设置拖拽条高度
resize.style.top = moveLen
// 设置上部div高度
document.getElementById(TopId).style.height = moveLen + "px"
// 设置下部div高度
document.getElementById(BottomId).style.height = (box.clientHeight - moveLen - config.barHeight) + "px"
}
// 鼠标停止事件
document.onmouseup = () => {
// 事件初始化
document.onmousemove = null
document.onmouseup = null
// 释放拖捕获鼠标
resize.releaseCapture && resize.releaseCapture()
// 回调函数
onmouseupCallback(moveLen, box.clientHeight - moveLen - config.barHeight)
}
// 捕获鼠标
resize.setCapture && resize.setCapture()
return false
}
}

+ 2
- 2
src/views/factoryModel/customer/addOrEdit.vue View File

@ -160,14 +160,14 @@
<el-input v-model.number="formData['Customer-LockWeeks']" placeholder="请输入" />
</el-form-item>
</el-col>
<el-col :span="8">
<!-- <el-col :span="8">
<el-form-item
:label="getColumnName('Customer-EnableDemandLockToggle')"
prop="Customer-EnableDemandLockToggle" >
<el-switch v-model="formData['Customer-EnableDemandLockToggle']" active-color="#35B0A6" inactive-color="#FF3B31" />
</el-form-item>
</el-col>
</el-col> -->
</el-row>
</el-form>
<template #footer>


+ 0
- 1
src/views/factoryModel/customer/index.vue View File

@ -90,7 +90,6 @@ export default {
"Customer-LastModify",
"Customer-LastUser",
"Customer-CreateTime",
"Customer-EnableDemandLockToggle",
"Customer-LockWeeks"
],
tableHeight:0


+ 584
- 561
src/views/productionPlanning/customerForecastDemandReview/demandPlanning/articleDemand/index.vue
File diff suppressed because it is too large
View File


+ 4
- 8
src/views/productionPlanning/customerForecastDemandReview/demandPlanning/index.vue View File

@ -79,11 +79,6 @@
])
},
watch: {
// customerId:function(id){
// if(id){
// this.getDataList(id)
// }
// },
articleDemandData: function (data) {
if (data) {
this.dealArticleDemandData(data);
@ -110,7 +105,7 @@
this.tableData.forEach(item => {
if (item.key == row.key) {
if (item.Label != "净生产量") {
item.show = true;
item.show = !item.show;
}
charData.push(item);
} else {
@ -120,7 +115,7 @@
}
});
this.setCharData(charData);
this.$refs.articleDemandTable.setCurrentRow(this.tableData[this.selectArticleDemandRowIndex]);
// this.$refs.articleDemandTable.setCurrentRow(this.tableData[this.selectArticleDemandRowIndex]);
},
//
setCharData(data) {
@ -152,10 +147,11 @@
},
getDataList(param) {
this.SET_articleDemandLoading(true);
getCustomerArticleDemand(param).then(({ data = [] }) => {
this.SET_articleDemandData(data);
this.SET_articleDemandLoading(false);
this.$refs.articleDemandTable.pagination.total = data.count
console.log('%cindex.vue line:154 this.$refs.articleDemandTable.pagination', 'color: #007acc;', this.$refs.articleDemandTable.pagination);
}).catch(() => {
this.SET_articleDemandLoading(false);
});


+ 1
- 1
src/views/productionPlanning/customerForecastDemandReview/index.vue View File

@ -110,7 +110,7 @@
},
mounted() {
this.dragChangeSize((moveLen, bottomHeight) => {
this.SET_articleDemandHeight((moveLen - 145) + "px");
this.SET_articleDemandHeight((moveLen - 175) + "px");
this.SET_calculateTableHeight((bottomHeight - 60) + "px");
});
},


+ 102
- 100
src/views/productionPlanning/customerForecastDemandReview/resourceContent/evaluation/index.vue View File

@ -1,115 +1,117 @@
<template>
<div class="wrapper">
<div class="tool_list">
<div class="button_list">
<!-- <img class="image_button" :src="refreshImageUrl" @click="refreshData" title="刷新数据"> -->
<el-switch v-model="showChar"
inactive-text="显示图表"
active-color="#35B0A6"
inactive-color="#FF3B31" title="显示图表" />
</div>
</div>
<template v-if="showChar">
<div class="char_box" v-if="evaluationMainResourceData.length">
<Char :DataList="evaluationMainResourceData" Title="主要资源"></Char>
</div>
<el-progress type="circle" :percentage="evaluationLoadPercent" v-if="evaluationLoadPercent"></el-progress>
<template v-if="evaluationSecondResourceListData.length">
<template v-for="(evaluationSecondResourceData,index) in evaluationSecondResourceListData" :key="index">
<div class="char_box" v-loading='evaluationSecondResourceLoading'>
<Char :DataList="evaluationSecondResourceData" :Opacity=0.8 :Title="'次要资源('+(index+1)+')'"></Char>
</div>
</template>
<div class="tool_list">
<div class="button_list">
<!-- <img class="image_button" :src="refreshImageUrl" @click="refreshData" title="刷新数据"> -->
<el-switch v-model="showChar"
inactive-text="显示图表"
active-color="#35B0A6"
inactive-color="#FF3B31"
title="显示图表" />
</div>
</div>
<template v-if="showChar">
<el-progress type="circle"
:percentage="evaluationLoadPercent"
v-if="evaluationLoadPercent"></el-progress>
<div class="char_box"
v-if="evaluationMainResourceData.length && evaluationLoadPercent==0">
<Char :DataList="evaluationMainResourceData"
Title="主要资源"></Char>
</div>
<template v-if="evaluationSecondResourceListData.length">
<template v-for="(evaluationSecondResourceData,index) in evaluationSecondResourceListData"
:key="index">
<div class="char_box"
v-loading='evaluationSecondResourceLoading'>
<Char :DataList="evaluationSecondResourceData"
:Opacity=0.8
:Title="'次要资源('+(index+1)+')'"></Char>
</div>
</template>
</template>
</template>
</div>
</template>
<script>
import Char from './char'
import refreshImageUrl from '@/assets/icon/refresh.png'
import {mapState,mapMutations} from 'vuex'
import Char from './char'
import refreshImageUrl from '@/assets/icon/refresh.png'
import { mapState, mapMutations } from 'vuex'
export default {
components: {
Char,
},
data() {
return {
showChar:true,
refreshImageUrl:refreshImageUrl,
};
},
created(){
export default {
components: {
Char,
},
data() {
return {
showChar: false,
refreshImageUrl: refreshImageUrl,
};
},
created() {
},
computed: {
...mapState("customerForecastDemandReview",[
'evaluationLoadPercent',
'evaluationSecondResourceLoading',
'evaluationMainResourceLoading',
'evaluationSecondResourceListData',
'evaluationMainResourceData'
},
computed: {
...mapState("customerForecastDemandReview", [
'evaluationLoadPercent',
'evaluationSecondResourceLoading',
'evaluationMainResourceLoading',
'evaluationSecondResourceListData',
'evaluationMainResourceData'
])
},
methods: {
...mapMutations("customerForecastDemandReview",["SET_evaluationLoadPercent"])
},
};
},
methods: {
...mapMutations("customerForecastDemandReview", ["SET_evaluationLoadPercent"])
},
};
</script>
<style lang="less" scoped>
.wrapper {
min-height: 100%;
width: 100%;
display: flex;
flex-direction: column;
<style lang="less"
scoped>
.wrapper {
min-height: 100%;
width: 100%;
display: flex;
flex-direction: column;
:deep(.el-progress-circle) {
:deep(.el-progress-circle) {
margin: 100px auto;
}
.tool_list{
width: 100%;
height: 30px;
display: flex;
justify-content: flex-end;
.button_list {
width: 120px;
height: 32px;
display: flex;
margin: 100px auto;
}
.tool_list {
width: 100%;
height: 30px;
display: flex;
justify-content: flex-end;
.button_list {
width: 120px;
height: 32px;
display: flex;
margin-right: 50px;
align-items: center;
.image_button {
margin: 2px 5px;
width: 24px;
height: 24px;
box-shadow: 2px 2px 0px 0px #DADADA;
border: 1px solid #FFFFFF;
}
.image_button:hover {
background: #DFDFDF;
box-shadow: 2px 2px 0px 0px #FFFFFF;
border-radius: 1px;
border: 1px solid #DADADA;
}
.button_split {
width: 1px;
height: 30px;
background: #DFDFDF;
box-shadow: 1px 0px 0px 0px #FFFFFF;
border-radius: 1px;
}
}
}
.char_box{
width:100%;
height: 300px
align-items: center;
.image_button {
margin: 2px 5px;
width: 24px;
height: 24px;
box-shadow: 2px 2px 0px 0px #DADADA;
border: 1px solid #FFFFFF;
}
.image_button:hover {
background: #DFDFDF;
box-shadow: 2px 2px 0px 0px #FFFFFF;
border-radius: 1px;
border: 1px solid #DADADA;
}
.button_split {
width: 1px;
height: 30px;
background: #DFDFDF;
box-shadow: 1px 0px 0px 0px #FFFFFF;
border-radius: 1px;
}
}
}
.char_box {
width: 100%;
height: 300px
}
}
}
</style>

Loading…
Cancel
Save