Browse Source

Merge pull request '添加字段' (#175) from xuxiaoming into develop

Reviewed-on: http://101.201.121.115:3000/leo/LAPP_AdvancedPlanner_Front/pulls/175
pull/176/head
xuxiaoming 3 years ago
parent
commit
4149db574c
2 changed files with 383 additions and 288 deletions
  1. +100
    -75
      src/views/factoryModel/materialResourceMaintenance/artStockResource/index.vue
  2. +283
    -213
      src/views/plan/workbench/homePage/beta/predict/index.vue

+ 100
- 75
src/views/factoryModel/materialResourceMaintenance/artStockResource/index.vue View File

@ -2,9 +2,9 @@
<div ref="tableRef" class="table-height-wrap">
<SearchTemplate>
<el-form :inline="true" class="clearfix search-content">
<el-form-item :label="getColumnName('AP_ArticleStockLevel-ArtId')">
<el-input v-model="queryParams.ArtId" placeholder="请输入" clearable></el-input>
<!-- <el-select
<el-form-item :label="getColumnName('AP_ArticleStockLevel-ArtId')">
<el-input v-model="queryParams.ArtId" placeholder="请输入" clearable></el-input>
<!-- <el-select
v-model="queryParams.ArtId"
placeholder="请选择"
>
@ -16,18 +16,15 @@
/>
</el-select> -->
</el-form-item>
<el-form-item :label="getColumnName('AP_ArticleStockLevel-CompleteStatus')">
<el-select
v-model="queryParams.CompleteStatus"
placeholder="请选择"
>
<el-option
v-for="item in completeStatusList"
:key="item['Stdef-StdefTyp']"
:label="item['Stdef-Bez']"
:value="item['Stdef-StdefTyp']"
/>
</el-select>
<el-form-item :label="getColumnName('AP_ArticleStockLevel-CompleteStatus')">
<el-select v-model="queryParams.CompleteStatus" placeholder="请选择">
<el-option
v-for="item in completeStatusList"
:key="item['Stdef-StdefTyp']"
:label="item['Stdef-Bez']"
:value="item['Stdef-StdefTyp']"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
@ -68,28 +65,48 @@
:data="tableData"
border
size="mini"
v-if="tableHeight" :height="tableHeight"
v-if="tableHeight"
:height="tableHeight"
>
<el-table-column
v-for="item in headers"
:key="item"
:label="getColumnName(item)"
:prop="item"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span v-if="item === 'AP_ArticleStockLevel-PlantNr'">{{
mappingText(planList, scope.row["AP_ArticleStockLevel-PlantNr"], 'Plant-PlantNr', 'Plant-Name1')
mappingText(
planList,
scope.row["AP_ArticleStockLevel-PlantNr"],
"Plant-PlantNr",
"Plant-Name1"
)
}}</span>
<span v-else-if="item === 'AP_ArticleStockLevel-MinCoverPeriodType'">{{
mappingText(minCoverPeriodTypeArray, scope.row["AP_ArticleStockLevel-MinCoverPeriodType"], 'Stdef-StdefTyp', 'Stdef-Bez')
mappingText(
minCoverPeriodTypeArray,
scope.row["AP_ArticleStockLevel-MinCoverPeriodType"],
"Stdef-StdefTyp",
"Stdef-Bez"
)
}}</span>
<span v-else-if="item === 'AP_ArticleStockLevel-MaxCoverPeriodType'">{{
mappingText(maxCoverPeriodTypeArray, scope.row["AP_ArticleStockLevel-MaxCoverPeriodType"], 'Stdef-StdefTyp', 'Stdef-Bez')
mappingText(
maxCoverPeriodTypeArray,
scope.row["AP_ArticleStockLevel-MaxCoverPeriodType"],
"Stdef-StdefTyp",
"Stdef-Bez"
)
}}</span>
<span v-else-if="item === 'AP_ArticleStockLevel-CompleteStatus'">{{
mappingText(completeStatusList, scope.row["AP_ArticleStockLevel-CompleteStatus"], 'Stdef-StdefTyp', 'Stdef-Bez')
mappingText(
completeStatusList,
scope.row["AP_ArticleStockLevel-CompleteStatus"],
"Stdef-StdefTyp",
"Stdef-Bez"
)
}}</span>
<span v-else>{{ scope.row[item] }}</span>
</template>
@ -141,27 +158,33 @@
/>
<Upload v-if="importDialogVisible" @editCallBack="completeCallBack" />
</div>
</template>
<script>
import AddOrEdit from "./addOrEdit.vue";
import Upload from "./upload.vue";
import { ListMixin } from "@/mixins/newListMixin";
import { queryTableData, getPlantList } from "@/server/factoryModel/materialResourceMaintenance/inventoryLevels";
import { deleteHanle,getArtIdList, getMainResourceList, getSecondaryResourceList, } from "@/server/factoryModel/materialResourceMaintenance/artStockResource";
import {
queryTableData,
getPlantList,
} from "@/server/factoryModel/materialResourceMaintenance/inventoryLevels";
import {
deleteHanle,
getArtIdList,
getMainResourceList,
getSecondaryResourceList,
} from "@/server/factoryModel/materialResourceMaintenance/artStockResource";
export default {
components: {
AddOrEdit,
Upload
Upload,
},
mixins: [ListMixin],
data() {
return {
importDialogVisible:false,
tableHeight:0,
importDialogVisible: false,
tableHeight: 0,
queryTableData: queryTableData,
loading: false,
isAddOrEdit: false,
@ -172,38 +195,35 @@ export default {
"AP_ArticleStockLevel-PlantNr",
"AP_ArticleStockLevel-ArtId",
"AP_ArticleStockLevel-Descr",
"AP_ArticleStockLevel-MainResourceId",
"AP_ArticleStockLevel-MinCoverPeriod",
"AP_ArticleStockLevel-MinCoverPeriodType",
"AP_ArticleStockLevel-MaxCoverPeriod",
"AP_ArticleStockLevel-MaxCoverPeriodType",
"AP_ArticleStockLevel-CompleteStatus"
"AP_ArticleStockLevel-CompleteStatus",
],
planList:[],//
articleList:[], //
minCoverPeriodTypeArray:[],
maxCoverPeriodTypeArray:[],
completeStatusList:[],
mainResourceList:[],
secondaryResourceList:[],
}
planList: [], //
articleList: [], //
minCoverPeriodTypeArray: [],
maxCoverPeriodTypeArray: [],
completeStatusList: [],
mainResourceList: [],
secondaryResourceList: [],
};
},
created(){
this.getStanderData()
created() {
this.getStanderData();
},
mounted(){
mounted() {
this.getList();
this.$nextTick(() => {
this.tableHeight = this.calculationTableHeight(
this.$refs.tableRef,
120
);
})
this.tableHeight = this.calculationTableHeight(this.$refs.tableRef, 120);
});
},
methods: {
//
completeCallBack() {
this.importDialogVisible = false
this.importDialogVisible = false;
},
//
handleQuery() {
@ -231,36 +251,41 @@ export default {
this.delHanle(deleteHanle(item["AP_ArticleStockLevel-ArtId"]));
},
getStanderData(){
getMainResourceList().then(({ data = [] }) => {
this.mainResourceList = data;
});
getSecondaryResourceList().then(({ data = [] }) => {
this.secondaryResourceList = data;
});
getArtIdList().then(({data=[]})=>{
this.articleList=data;
})
getPlantList().then(({data=[]})=>{
this.planList=data;
})
this.getStanderOne({ statid: 'AP_ArticleStockLevel-MinCoverPeriodType' }).then((res) => {
this.minCoverPeriodTypeArray = res.data
})
this.getStanderOne({ statid: 'AP_ArticleStockLevel-MaxCoverPeriodType' }).then((res) => {
this.maxCoverPeriodTypeArray = res.data
})
this.getStanderOne({ statid: 'AP_ArticleStockLevel-CompleteStatus' }).then((res) => {
this.completeStatusList = res.data
})
}
getStanderData() {
getMainResourceList().then(({ data = [] }) => {
this.mainResourceList = data;
});
getSecondaryResourceList().then(({ data = [] }) => {
this.secondaryResourceList = data;
});
getArtIdList().then(({ data = [] }) => {
this.articleList = data;
});
getPlantList().then(({ data = [] }) => {
this.planList = data;
});
this.getStanderOne({
statid: "AP_ArticleStockLevel-MinCoverPeriodType",
}).then((res) => {
this.minCoverPeriodTypeArray = res.data;
});
this.getStanderOne({
statid: "AP_ArticleStockLevel-MaxCoverPeriodType",
}).then((res) => {
this.maxCoverPeriodTypeArray = res.data;
});
this.getStanderOne({
statid: "AP_ArticleStockLevel-CompleteStatus",
}).then((res) => {
this.completeStatusList = res.data;
});
},
},
};
</script>
<style lang="less" scoped>
.table-height-wrap{
height: 100%;
overflow: hidden;
}
.table-height-wrap {
height: 100%;
overflow: hidden;
}
</style>

+ 283
- 213
src/views/plan/workbench/homePage/beta/predict/index.vue View File

@ -1,226 +1,296 @@
<template>
<div class="predict-wrapper">
<queryComponent
:customerId="customerId"
:CreateModel="CreateModel"
:isShowComponent="isShowComponent"
:isShowAddButton="true"
:isDropdown="true"
:batchImport="batchImport"
@searchEmit="searchEmitHandle"
@resetEmit="resetEmitHandle"
@batchReleaseEmit="batchReleaseEmit"
/>
<div class="content-table-wrap" ref="topTableRef">
<el-table
class="predict-table"
v-if="tableHeight"
:height="tableHeight"
:data="tableData"
v-loading="loading"
size="mini"
@selection-change="handleSelectionChange"
border>
<el-table-column type="selection" width="55" align="center" />
<el-table-column v-for="(item, index) in headers" :key="index" :label="getColumnName(item)" width="170" :show-overflow-tooltip="true">
<template #default="scope">
<span v-if="item === 'AP_CustDemandVerHead-PlantNr'">{{ getWorkshopName(scope.row['AP_CustDemandVerHead-PlantNr']) }}</span>
<span v-else-if="item === 'AP_CustDemandVerHead-Status'">{{ scope.row['AP_CustDemandVerHead-Status'] == '1' ? '已发布':'未发布' }}</span>
<span v-else-if="item === 'AP_CustDemandVerHead-GlobalPublish'">{{ scope.row['AP_CustDemandVerHead-GlobalPublish'] == 1 ? '是':'否' }}</span>
<span v-else-if="item === 'AP_CustDemandVerHead-Valid'">{{ scope.row['AP_CustDemandVerHead-Valid'] == true ? '当前使用':'' }}</span>
<span v-else>{{ scope.row[item] }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="350" fixed="right">
<template #default="scope">
<el-button class="edit-button-style" :disabled="!customerId" @click="handleRing(scope.row)" icon="el-icon-pie-chart" size="small">环比</el-button>
<el-button class="edit-button-style" :disabled="!customerId" @click="handleWith(scope.row)" icon="el-icon-s-data" size="small">同比</el-button>
<el-button class="edit-button-style" @click="handleEdit(scope.row)" icon="el-icon-edit" size="small">修改</el-button>
<el-button class="edit-button-style" @click="handleCopy(scope.row)" icon="el-icon-document-copy" size="small">复制</el-button>
</template>
</el-table-column>
</el-table>
<Pagination v-show="pagination.total>0" v-model:pagination="pagination" @change="getPredictList" />
</div>
</div>
<div class="predict-wrapper">
<queryComponent
:customerId="customerId"
:CreateModel="CreateModel"
:isShowComponent="isShowComponent"
:isShowAddButton="true"
:isDropdown="true"
:batchImport="batchImport"
@searchEmit="searchEmitHandle"
@resetEmit="resetEmitHandle"
@batchReleaseEmit="batchReleaseEmit"
/>
<div class="content-table-wrap" ref="topTableRef">
<el-table
class="predict-table"
v-if="tableHeight"
:height="tableHeight"
:data="tableData"
v-loading="loading"
size="mini"
@selection-change="handleSelectionChange"
border
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
v-for="(item, index) in headers"
:key="index"
:label="getColumnName(item)"
width="170"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span v-if="item === 'AP_CustDemandVerHead-PlantNr'">{{
getWorkshopName(scope.row["AP_CustDemandVerHead-PlantNr"])
}}</span>
<span v-else-if="item === 'AP_CustDemandVerHead-Status'">{{
scope.row["AP_CustDemandVerHead-Status"] == "1" ? "已发布" : "未发布"
}}</span>
<span v-else-if="item === 'AP_CustDemandVerHead-GlobalPublish'">{{
scope.row["AP_CustDemandVerHead-GlobalPublish"] == 1 ? "是" : "否"
}}</span>
<span v-else-if="item === 'AP_CustDemandVerHead-Valid'">{{
scope.row["AP_CustDemandVerHead-Valid"] == true ? "当前使用" : ""
}}</span>
<span v-else>{{ scope.row[item] }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="350" fixed="right">
<template #default="scope">
<el-button
class="edit-button-style"
:disabled="!customerId"
@click="handleRing(scope.row)"
icon="el-icon-pie-chart"
size="small"
>环比</el-button
>
<el-button
class="edit-button-style"
:disabled="!customerId"
@click="handleWith(scope.row)"
icon="el-icon-s-data"
size="small"
>同比</el-button
>
<el-button
class="edit-button-style"
@click="handleEdit(scope.row)"
icon="el-icon-edit"
size="small"
>修改</el-button
>
<el-button
class="edit-button-style"
@click="handleCopy(scope.row)"
icon="el-icon-document-copy"
size="small"
>复制</el-button
>
</template>
</el-table-column>
</el-table>
<Pagination
v-show="pagination.total > 0"
v-model:pagination="pagination"
@change="getPredictList"
/>
</div>
</div>
</template>
<script>
import { get } from "@/server/api.js";
import { mapMutations } from "vuex";
import queryComponent from '@/components/queryComponent'
import queryComponent from "@/components/queryComponent";
export default {
components: {
queryComponent
},
props: ["customerId", "CreateModel", "isShowComponent","tableHeight"],
data() {
return {
tableData: [],
headers: [
"AP_CustDemandVerHead-PlantNr",
"AP_CustDemandVerHead-CustomerId",
"AP_CustDemandVerHead-VersionId",
"AP_CustDemandVerHead-Descr",
"AP_CustDemandVerHead-Valid",
"AP_CustDemandVerHead-Status",
"AP_CustDemandVerHead-GlobalPublish",
"AP_CustDemandVerHead-PlanReleaseTime",
"AP_CustDemandVerHead-ActualReleaseTime",
// "AP_CustDemandVerHead-CreateMode",
"AP_CustDemandVerHead-CreateUser",
"AP_CustDemandVerHead-LastModify",
"AP_CustDemandVerHead-LastUser",
"AP_CustDemandVerHead-CreateTime",
],
loading: false,
artId: undefined,
valid: undefined,
versionId: undefined,
status: undefined,
pagination: {
//
pageNumber: 1,
pageSize: 10,
total: 0,
pageSizes:[10,50,100,200]
},
batchImport: [],
// isRefreshList: false,
}
},
methods: {
//
batchReleaseEmit(value) {
// this.isRefreshList = value
if (value) {
this.getPredictList()
}
},
//
handleSelectionChange(val) {
this.batchImport = []
val.forEach(el => {
this.batchImport.push({
"AP_CustDemandVerHead-CustomerId": el['AP_CustDemandVerHead-CustomerId'],
"AP_CustDemandVerHead-VersionId": el['AP_CustDemandVerHead-VersionId']
})
})
components: {
queryComponent,
},
props: ["customerId", "CreateModel", "isShowComponent", "tableHeight"],
data() {
return {
tableData: [],
headers: [
"AP_CustDemandVerHead-PlantNr",
"AP_CustDemandVerHead-CustomerId",
"AP_CustDemandVerHead-CustomerName",
"AP_CustDemandVerHead-VersionId",
"AP_CustDemandVerHead-Descr",
"AP_CustDemandVerHead-Valid",
"AP_CustDemandVerHead-Status",
"AP_CustDemandVerHead-GlobalPublish",
"AP_CustDemandVerHead-PlanReleaseTime",
"AP_CustDemandVerHead-ActualReleaseTime",
// "AP_CustDemandVerHead-CreateMode",
"AP_CustDemandVerHead-CreateUser",
"AP_CustDemandVerHead-LastModify",
"AP_CustDemandVerHead-LastUser",
"AP_CustDemandVerHead-CreateTime",
],
loading: false,
artId: undefined,
valid: undefined,
versionId: undefined,
status: undefined,
pagination: {
//
pageNumber: 1,
pageSize: 10,
total: 0,
pageSizes: [10, 50, 100, 200],
},
batchImport: [],
// isRefreshList: false,
};
},
methods: {
//
batchReleaseEmit(value) {
// this.isRefreshList = value
if (value) {
this.getPredictList();
}
},
...mapMutations("homePageStore", ["getWithRingStatus"]),
handleRing(row) { //
let newData = {}
newData.activeName = 'second'
newData.withTheRing = '2'
newData.versonId = row['AP_CustDemandVerHead-VersionId']
this.getWithRingStatus(newData)
},
handleWith(row) { //
let newData = {}
newData.activeName = 'second'
newData.withTheRing = '1'
newData.versonId = row['AP_CustDemandVerHead-VersionId']
this.getWithRingStatus(newData)
},
//
getPredictList(id, artId, valid, versionId, status) {
this.loading = true
let customerId = undefined
let grouptype = undefined
if (id === 'MAIN' || this.customerId === 'MAIN') { //
customerId = undefined
grouptype = undefined
} else if (id === 'CUST' || id === 'GRP' || this.customerId === 'CUST' || this.customerId === 'GRP') { //
customerId = undefined
grouptype = id
} else { //
customerId = id || this.customerId
grouptype = undefined
}
get(`/admin/ap/custdemandverhead/selectdata`, {
...this.pagination,
customerId: customerId,
artId: artId || this.artId,
valid: valid || this.valid,
versionId: versionId || this.versionId,
status: status || this.status,
grouptype: grouptype
}).then(({ code, data: { count = 0, records = [] } }) => {
if (code === 200) {
this.loading = false
this.tableData = records || []
this.pagination.total = count
} else {
this.loading = false
}
}).catch(() => {
this.loading = false
})
},
searchEmitHandle(data) {
this.getPredictList(this.customerId, data.artId, data.valid, data.versionId, data.status)
},
resetEmitHandle() {
this.getPredictList(this.customerId)
},
//
//
handleSelectionChange(val) {
this.batchImport = [];
val.forEach((el) => {
this.batchImport.push({
"AP_CustDemandVerHead-CustomerId": el["AP_CustDemandVerHead-CustomerId"],
"AP_CustDemandVerHead-VersionId": el["AP_CustDemandVerHead-VersionId"],
});
});
},
...mapMutations("homePageStore", ["getWithRingStatus"]),
handleRing(row) {
//
let newData = {};
newData.activeName = "second";
newData.withTheRing = "2";
newData.versonId = row["AP_CustDemandVerHead-VersionId"];
this.getWithRingStatus(newData);
},
handleWith(row) {
//
let newData = {};
newData.activeName = "second";
newData.withTheRing = "1";
newData.versonId = row["AP_CustDemandVerHead-VersionId"];
this.getWithRingStatus(newData);
},
//
getPredictList(id, artId, valid, versionId, status) {
this.loading = true;
let customerId = undefined;
let grouptype = undefined;
if (id === "MAIN" || this.customerId === "MAIN") {
//
customerId = undefined;
grouptype = undefined;
} else if (
id === "CUST" ||
id === "GRP" ||
this.customerId === "CUST" ||
this.customerId === "GRP"
) {
//
customerId = undefined;
grouptype = id;
} else {
//
customerId = id || this.customerId;
grouptype = undefined;
}
get(`/admin/ap/custdemandverhead/selectdata`, {
...this.pagination,
customerId: customerId,
artId: artId || this.artId,
valid: valid || this.valid,
versionId: versionId || this.versionId,
status: status || this.status,
grouptype: grouptype,
})
.then(({ code, data: { count = 0, records = [] } }) => {
if (code === 200) {
this.loading = false;
this.tableData = records || [];
this.pagination.total = count;
} else {
this.loading = false;
}
})
.catch(() => {
this.loading = false;
});
},
searchEmitHandle(data) {
this.getPredictList(
this.customerId,
data.artId,
data.valid,
data.versionId,
data.status
);
},
resetEmitHandle() {
this.getPredictList(this.customerId);
},
//
handleNew() {
if (!this.customerId) {
this.msgError('请先选择客户')
return
}
this.$router.push({path:'/plan/workbench/homePage/beta/predict/predictEdit', query: {
CustomerId: this.customerId,
CreateModel: this.CreateModel,
}})
if (!this.customerId) {
this.msgError("请先选择客户");
return;
}
this.$router.push({
path: "/plan/workbench/homePage/beta/predict/predictEdit",
query: {
CustomerId: this.customerId,
CreateModel: this.CreateModel,
},
});
},
//
handleEdit(row) {
this.$router.push({path:'/plan/workbench/homePage/beta/predict/predictEdit',query: {
CustomerId: row['AP_CustDemandVerHead-CustomerId'],
VersionId: row['AP_CustDemandVerHead-VersionId'],
title: '修改'
}})
},
//
handleCopy(row) {
this.$router.push({path:'/plan/workbench/homePage/beta/predict/predictEdit',query: {
CustomerId: row['AP_CustDemandVerHead-CustomerId'],
VersionId: row['AP_CustDemandVerHead-VersionId'],
CreateModel: row['AP_CustDemandVerHead-CreateMode'],
title: '复制'
}})
},
},
mounted() {
this.$nextTick(()=>{
let tableHeight = this.calculationTableHeight(
this.$refs.topTableRef,
40
);
this.$emit('calculateTableHeight', tableHeight)
})
},
watch: {
// ID
customerId: {
handler (data) {
this.getPredictList(data)
},
deep: true
}
}
}
//
handleEdit(row) {
this.$router.push({
path: "/plan/workbench/homePage/beta/predict/predictEdit",
query: {
CustomerId: row["AP_CustDemandVerHead-CustomerId"],
VersionId: row["AP_CustDemandVerHead-VersionId"],
title: "修改",
},
});
},
//
handleCopy(row) {
this.$router.push({
path: "/plan/workbench/homePage/beta/predict/predictEdit",
query: {
CustomerId: row["AP_CustDemandVerHead-CustomerId"],
VersionId: row["AP_CustDemandVerHead-VersionId"],
CreateModel: row["AP_CustDemandVerHead-CreateMode"],
title: "复制",
},
});
},
},
mounted() {
this.$nextTick(() => {
let tableHeight = this.calculationTableHeight(this.$refs.topTableRef, 40);
this.$emit("calculateTableHeight", tableHeight);
});
},
watch: {
// ID
customerId: {
handler(data) {
this.getPredictList(data);
},
deep: true,
},
},
};
</script>
<style lang="less" scoped>
.predict-wrapper {
height: 100%;
.content-table-wrap {
width: 100%;
height: 100%;
}
.predict-table {
margin-top: 10px;
width: 100%;
}
height: 100%;
.content-table-wrap {
width: 100%;
height: 100%;
}
.predict-table {
margin-top: 10px;
width: 100%;
}
}
</style>
</style>

Loading…
Cancel
Save