Browse Source

完成新需求修改

pull/23/head
xuxiaoming 3 years ago
parent
commit
22e77a96e1
6 changed files with 110 additions and 11 deletions
  1. +4
    -0
      src/server/productionPlanning/customerForecastDemandReview.js
  2. +21
    -2
      src/views/productionPlanning/customerForecastDemandReview/demandPlanning/articleDemand/index.vue
  3. +48
    -3
      src/views/productionPlanning/customerForecastDemandReview/demandPlanning/index.vue
  4. +19
    -3
      src/views/productionPlanning/customerForecastDemandReview/index.vue
  5. +3
    -3
      src/views/productionPlanning/customerForecastDemandReview/resourceContent/evaluation/char.vue
  6. +15
    -0
      src/views/productionPlanning/customerForecastDemandReview/resourceContent/index.vue

+ 4
- 0
src/server/productionPlanning/customerForecastDemandReview.js View File

@ -42,6 +42,10 @@ export const getCustomerDemand = (params) => get('/admin/ap/custdemandverhead/se
// 数据重载
export const reloadData = () => get('/admin/ap/balance/refreshdata')
// 刷新数据
export const refreshData = (data) => post('/admin/ap/balance/refreshcustomerarticledemand',data)
// 客户主要资源查询
export const searchResource = (artId) => get(`/admin/ap/articleresource/search/${artId}`);


+ 21
- 2
src/views/productionPlanning/customerForecastDemandReview/demandPlanning/articleDemand/index.vue View File

@ -33,7 +33,7 @@
<div class="button_split"></div>
<img class="image_button" :src="netProductionImageUrl" @click="editField = '净生产量'" title="净生产量">
<div class="button_split"></div>
<img class="image_button" :src="refreshImageUrl" title="刷新数据">
<img class="image_button" :src="refreshImageUrl" @click="refreshData" title="刷新数据">
<div class="button_split"></div>
<img class="image_button" :src="saveImageUrl" @click="saveDemandData" title="保存">
<div class="button_split"></div>
@ -69,7 +69,7 @@ import netProductionImageUrl from '@/assets/icon/net_production.png'
import reloadImageUrl from '@/assets/icon/reload.png'
import refreshImageUrl from '@/assets/icon/refresh.png'
import saveImageUrl from '@/assets/icon/save.png'
import { reloadData } from "@/server/productionPlanning/customerForecastDemandReview";
import { reloadData} from "@/server/productionPlanning/customerForecastDemandReview";
export default {
@ -121,6 +121,15 @@ export default {
})
},
methods: {
refreshData(){
let data = []
this.TableData.forEach(item => {
if(item['-'] == this.editField){
data = item
}
})
this.$emit("refreshData",data)
},
reloadData(){
reloadData().then( ({msg}) => {
this.$message({
@ -151,6 +160,16 @@ export default {
},
calcHandle() {
let data = []
this.TableData.forEach(item => {
if(item['-'] == this.editField){
data = item
}
})
this.$emit("calcHandle",{
data:data,
mode:this.mode
})
},
},
}


+ 48
- 3
src/views/productionPlanning/customerForecastDemandReview/demandPlanning/index.vue View File

@ -13,6 +13,8 @@
:Height="tableHeight+'px'"
:TableData="tableData"
@saveDemandData="saveDemandData"
@refreshData="refreshData"
@calcHandle="calcHandle"
@calculateTableHeight="calculateTableHeight"
/>
<ArticleChar
@ -28,7 +30,7 @@
</ContentContainer>
</template>
<script>
import { getCustomerArticleDemand,saveDemand } from "@/server/productionPlanning/customerForecastDemandReview";
import { getCustomerArticleDemand,saveDemand,refreshData,changeMpsPlan } from "@/server/productionPlanning/customerForecastDemandReview";
//
import ArticleDemand from "./articleDemand";
//
@ -54,6 +56,11 @@ export default {
type: String,
default: "",
},
// ID
resourceId:{
type: String,
default:""
},
},
data() {
return {
@ -88,6 +95,45 @@ export default {
});
},
methods: {
refreshData(data) {
if(data) {
this.apiData.forEach(item => {
let key = "WK" + item['AP_ArticleDemand-DemandWeek']
item[this.keyLabelMap[data['-']]] = data[key]
})
}
refreshData(this.apiData).then( ( {data = []} )=> {
this.tableData = [];
this.headers = [];
this.dealData(data);
this.$message({
type:"success",
message: "刷新成功"
})
}).catch(() => {
this.$message({
type:"error",
message: "刷新失败"
})
})
},
calcHandle(obj){
console.log('%cindex.vue line:121 obj', 'color: #007acc;', obj);
let data = obj.data
if(data) {
this.apiData.forEach(item => {
let key = "WK" + item['AP_ArticleDemand-DemandWeek']
item[this.keyLabelMap[data['-']]] = data[key]
})
}
this.$emit("calcHandle",{
mpstype : obj.mode,
demandlistdata : JSON.stringify({"ArticleDemandLst":this.apiData})
})
},
saveDemandData(data){
this.apiData.forEach(item => {
let key = "WK" + item['AP_ArticleDemand-DemandWeek']
@ -103,7 +149,6 @@ export default {
type:"error",
message: "保存失败"
})
})
},
handlePublic(){
@ -116,7 +161,7 @@ export default {
//
getDataList(customerId, artId) {
this.loading = true;
//
this.articleLoading = true;
getCustomerArticleDemand(customerId, artId)
.then(({ data = [] }) => {


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

@ -25,7 +25,12 @@
</div>
<!-- 右侧 需求计划 -->
<div class="homepage-top-right-wrap">
<DemandPlanning :customerId="customerId" :artId="artId" />
<DemandPlanning
:customerId="customerId"
:artId="artId"
:resourceId="resourceId"
@calcHandle="calcHandle"
/>
</div>
</div>
<!-- 下面模块 -->
@ -50,6 +55,7 @@
<!-- 右侧 资源负荷资源产能评估 -->
<div class="homepage-bottom-right-wrap">
<ResourceContent
:changeMpsPlanParam="changeMpsPlanParam"
:resourceId="resourceId"
:resourceType="resourceType"
@handleCancelResource="handleCancelResource"/>
@ -67,7 +73,7 @@ import ResourceContent from "./resourceContent";
import {
getMainResourceList,
getSecondaryResourceList,
custartSearch,
custartSearch,
searchResource
} from "@/server/productionPlanning/customerForecastDemandReview";
@ -103,7 +109,9 @@ export default {
//
resourceType: "",
//
filterCustomer: ""
filterCustomer: "",
changeMpsPlanParam:{},
};
},
created() {
@ -119,6 +127,14 @@ export default {
},
},
methods: {
calcHandle(param){
param.resouceid = this.resourceId
this.changeMpsPlanParam = param
// changeMpsPlan(param).then( ({ data = []}) => {
// this.calcData = data['ArticleResourceMpsGroupLst']
// })
},
//
handleCancelResource(){
this.changeTreeNodeStatus(this.$refs.resourceTree.store.root,false);


+ 3
- 3
src/views/productionPlanning/customerForecastDemandReview/resourceContent/evaluation/char.vue View File

@ -26,7 +26,7 @@ export default {
},
data(){
return {
chart:{},
weeksList:[],
resourceWorkTime:[],
legendList:[],
@ -41,7 +41,7 @@ export default {
},
methods: {
clearData(){
this.chart = {}
this.weeksList = []
this.resourceWorkTime = []
this.legendList = []
@ -89,7 +89,7 @@ export default {
//
initChart() {
let option = {
tooltip: { trigger: "axis", axisPointer: { type: "shadow" } },
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
legend: { data: this.legendList,top:'%1' },
grid: { top: '13%', left: "3%", right: "3%", bottom: "1%", containLabel: true },
xAxis: [{ type: "category", data: this.weeksList }],


+ 15
- 0
src/views/productionPlanning/customerForecastDemandReview/resourceContent/index.vue View File

@ -44,6 +44,10 @@ export default {
type: String,
default:""
},
changeMpsPlanParam:{
type: Object,
default: ()=> {}
},
},
data() {
return {
@ -97,6 +101,17 @@ export default {
}
},
watch: {
changeMpsPlanParam:function(param) {
this.evaluationNewLoading = true
this.evaluationDataNew = []
changeMpsPlan(param).then( ({ data = []}) => {
this.evaluationNewLoading = false
this.evaluationDataNew = data['ArticleResourceMpsGroupLst']
console.log('%cindex.vue line:87 this.evaluationDataNew', 'color: #007acc;', this.evaluationDataNew);
} ).catch(()=> {
this.evaluationNewLoading = false
})
},
resourceId:function(value) {
this.evaluationDataOld = this.evaluationDataNew = []
this.$refs.resourceLoadComponents.isCancelResource = false


Loading…
Cancel
Save