Browse Source

【长春派格1.5】物料管理页面开发

HQ
安虹睿 10 months ago
parent
commit
a8d13b6f53
  1. 36
      vue/src/router/modules/fis.js
  2. 317
      vue/src/views/pg-fis/basedate/SAPItemConfig/index.vue
  3. 12
      vue/src/views/pg-fis/basedate/planControl/index.vue

36
vue/src/router/modules/fis.js

@ -17,11 +17,31 @@ const pgfis = {
}, },
children: [ children: [
{ {
path: '/customerPartCfg', path: '/pg-planControl',
component: () => import('@/views/pg-fis/basedate/customerPartCfg'), component: () => import('@/views/pg-fis/basedate/planControl/index.vue'),
name: 'pg-planControl',//命名路由
meta: {
title: '计划管理',
//roles: ['SettleAccount.Reports'],
icon: '客户零件'
}
},
// {
// path: '/customerPartCfg',
// component: () => import('@/views/pg-fis/basedate/customerPartCfg'),
// name: 'customerPartCfg',//命名路由
// meta: {
// title: '客户零件管理',
// //roles: ['SettleAccount.Reports'],
// icon: '发货'
// }
// },
{
path: '/SAPItemConfig',
component: () => import('@/views/pg-fis/basedate/SAPItemConfig'),
name: 'customerPartCfg',//命名路由 name: 'customerPartCfg',//命名路由
meta: { meta: {
title: '客户零件管理', title: '物料管理',
//roles: ['SettleAccount.Reports'], //roles: ['SettleAccount.Reports'],
icon: '发货' icon: '发货'
} }
@ -146,16 +166,6 @@ const pgfis = {
icon: '客户零件' icon: '客户零件'
} }
}, },
{
path: '/pg-planControl',
component: () => import('@/views/pg-fis/basedate/planControl/index.vue'),
name: 'pg-planControl',//命名路由
meta: {
title: '计划管理',
//roles: ['SettleAccount.Reports'],
icon: '客户零件'
}
}
] ]
} }

317
vue/src/views/pg-fis/basedate/SAPItemConfig/index.vue

@ -0,0 +1,317 @@
<!--零件匹配关系页-->
<template>
<div class="cr-body-content">
<div ref="box">
<flexbox class="content-header">
<el-form
:model="listQuery"
ref="queryForm"
v-show="showSearch"
:inline="true"
>
<el-form-item label="物料号:" prop="MaterialNum">
<el-input
v-model="listQuery.MaterialNum"
clearable
size="small"
placeholder=""
style="width: 200px"
class="search-container"
@keyup.enter.native="handleFilter"
/>
</el-form-item>
<el-form-item label="物料描述:" prop="MaterialDescription">
<el-input
v-model="listQuery.MaterialDescription"
clearable
size="small"
placeholder=""
style="width: 200px"
class="search-container"
@keyup.enter.native="handleFilter"
/>
</el-form-item>
<el-form-item label="物料组:" prop="MaterialGroup">
<el-input
v-model="listQuery.MaterialGroup"
clearable
size="small"
placeholder=""
style="width: 200px"
class="search-container"
@keyup.enter.native="handleFilter"
/>
</el-form-item>
<el-form-item>
<el-button
size="mini"
type="success"
icon="el-icon-search"
@click="handleFilter"
>搜索
</el-button>
</el-form-item>
<el-form-item>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery('queryForm')"
>重置
</el-button>
</el-form-item>
<el-form-item>
<el-button
class="filter-item"
plain
size="mini"
type="warning"
icon="el-icon-bottom"
@click="handleDownload()"
>导出Excel
</el-button>
</el-form-item>
</el-form>
</flexbox>
</div>
<!--表格渲染-->
<el-table
ref="multipleTable"
v-loading="listLoading"
element-loading-text="拼命加载中..."
element-loading-spinner="el-icon-loading"
class="cr-table"
:data="list"
:height="tableHeight"
size="small"
stripe
border
highlight-current-row
style="width: 100%"
@sort-change="sortChange"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
>
<!-- <el-table-column type="selection" width="44px"></el-table-column> -->
<!-- <el-table-column
label="版本"
prop="version"
sortable="custom"
align="center"
width="100px"
>fixed 默认固定在左边
<template slot-scope="scope">
<el-tooltip :content="scope.row.version" placement="top">
<span class="link-type">{{ scope.row.version }}</span>
</el-tooltip>
</template>
</el-table-column> -->
<!-- show-overflow-tooltip -->
<el-table-column
v-for="(item, index) in getDefaultField"
:key="index"
:prop="item.prop"
:label="item.label"
:min-width="item.width"
:formatter="fieldFormatter"
sortable="custom"
:gutter="0"
>
<template slot="header" slot-scope="scope">
{{ scope.column.label }}
</template>
</el-table-column>
</el-table>
<div class="table-footer">
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"-->
<pagination
v-show="totalCount > 0"
:total="totalCount"
:page.sync="page"
:limit.sync="listQuery.MaxResultCount"
@pagination="getList"
/>
</div>
</div>
</template>
<script>
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import permission from "@/directive/permission/index.js";
import CRMTableHead from "../../components/CRMTableHead";
import moment from "moment";
import Lockr from "lockr";
import { downloadFile } from "@/utils/crmindex.js";
import XhJSSelect from "@/components/CreateCom/Xh-JS-Select-Label.vue";
export default {
name: "SAPItemConfig",
components: { Pagination, CRMTableHead, XhJSSelect },
directives: { permission },
data() {
return {
list: null,
totalCount: 0,
listLoading: true,
listQuery: {
SkipCount: 0,
MaxResultCount: 15,
MaterialNum:null,
MaterialDescription:null,
MaterialGroup:null,
MaterialType:3,
},
showSearch: true,
page: 1,
multipleSelection: [],
tableHeight: document.documentElement.clientHeight - 260,
sortState:false, //
partType1Query:{
dicTypeName:"客户零件类型1",
},
partType2Query:{
dicTypeName:"客户零件类型2",
},
};
},
mounted() {
this.$nextTick(() => {
var offsetHei = document.documentElement.clientHeight;
let boxH = this.$refs.box.offsetHeight;
this.tableHeight = offsetHei - boxH - 57 - 79;//57footer79
});
},
created() {
this.getList();
},
computed: {
/** 列表字段 */
getDefaultField() {
var tempsTabs = [
{ label: "物料号", prop: "materialNum",width: 160 },
{ label: "物料描述", prop: "materialDescription",width: 180 },
{ label: "大小量纲", prop: "materialDescription2",width: 160 },
{ label: "补充备注", prop: "materialMemo",width: 160 },
{ label: "物料组", prop: "materialGroup",width: 160 },
];
return tempsTabs;
},
},
methods: {
/** 格式化字段 */
fieldFormatter(row, column) {
/* if (column.property === "state") {
return { 0: "其他", 2: "已结" }[row[column.property]];
}*/
return row[column.property] || "--";
},
//
async handleDownload() {
this.listLoading = true;
this.$axios
.posts(
"/api/newjit/material/export",
this.listQuery
)
.then((res) => {
let filename = res.item;
this.$axios
.BolbGets("/api/newjit/exclude-part-cfg/download/" + filename)
.then((response) => {
if (filename.indexOf("_") != -1) {
let downName =
filename.slice(0, filename.lastIndexOf("_")) +
filename.slice(filename.lastIndexOf("."));
downloadFile(response, downName);
this.$notify({
title: "成功",
message: "数据-导出成功!",
type: "success",
duration: 2000,
});
} else {
downloadFile(response, filename);
this.$notify({
title: "成功",
message: "数据-导出成功!",
type: "success",
duration: 2000,
});
}
this.listLoading = false;
});
});
},
getList() {
this.listLoading = true;
this.listQuery.SkipCount = (this.page - 1) * 10;
this.$axios
.gets(
"/api/newjit/material/list",
this.listQuery
)
.then((response) => {
this.list = response.items;
this.totalCount = response.totalCount;
setTimeout(() => {
//
this.listLoading = false;
}, 500);
})
.catch(() => {
this.listLoading = false;
});
},
/** 筛选操作 */
handleFilter() {
this.page = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery(refName) {
this.$refs[refName].resetFields();
this.handleFilter();
},
sortChange(data) {
const { prop, order } = data;
if (!prop || !order) {
this.handleFilter();
return;
}
this.listQuery.Sorting = prop + " " + order;
if(this.listQuery.Filters.length>0 && this.listQuery.Filters[0].column === "Enabled")
{
this.sortState = false;
}
else
{
this.sortState = true;
}
this.handleFilter();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleRowClick(row, column, event) {
this.$refs.multipleTable.clearSelection();
this.$refs.multipleTable.toggleRowSelection(row);
},
},
};
</script>
<style lang="scss" scoped>
@import "../../../pg-fis/styles/crmtable.scss";
</style>
<style lang="scss">
.el-table .cell.el-tooltip {
white-space: pre-wrap;
}
</style>

12
vue/src/views/pg-fis/basedate/planControl/index.vue

@ -209,7 +209,6 @@
:min-width="item.width" :min-width="item.width"
:formatter="fieldFormatter" :formatter="fieldFormatter"
sortable="custom" sortable="custom"
show-overflow-tooltip
:gutter="0" :gutter="0"
> >
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
@ -218,6 +217,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<!-- show-overflow-tooltip -->
<div class="table-footer"> <div class="table-footer">
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> <!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"-->
@ -302,16 +302,13 @@
}; };
}, },
mounted() { mounted() {
this.getTipper();
let timer = setInterval(() => { let timer = setInterval(() => {
this.getTipper(); this.getTipper();
}, 60000); }, 60000);
this.$nextTick(() => {
this.getTipper();
this.changeMainTableHeight()
// var offsetHei = document.documentElement.clientHeight; // var offsetHei = document.documentElement.clientHeight;
// let boxH = this.$refs.box.offsetHeight; // let boxH = this.$refs.box.offsetHeight;
// this.tableHeight = offsetHei - boxH - 57 - 79;//57footer79 // this.tableHeight = offsetHei - boxH - 57 - 79;//57footer79
});
}, },
created() { created() {
this.getList(); this.getList();
@ -493,7 +490,10 @@
} }
_item = `<span style=${_style}>已经${res.timeoutMinutes}分钟没有导入计划\xa0\xa0\xa0\xa0</span>` _item = `<span style=${_style}>已经${res.timeoutMinutes}分钟没有导入计划\xa0\xa0\xa0\xa0</span>`
this.tipper += _item this.tipper += _item
this.changeMainTableHeight()
this.$nextTick(() => {
this.changeMainTableHeight()
})
}) })
} }
}, },

Loading…
Cancel
Save