领料申请数据查询

This commit is contained in:
ehkang
2021-06-17 17:03:50 +08:00
parent 66bdd1f1d2
commit 8bb0d8f6b9
12 changed files with 795 additions and 85 deletions

View File

@@ -26,7 +26,7 @@
<MenuGroup title="单据">
<MenuItem to="/inventoryrrival" name="4-2">到货单</MenuItem>
<MenuItem to="/inventoryerror" name="4-3">异常单据查询</MenuItem>
<MenuItem to="/inventoryMaterialAppVouch" name="4-2">领料单查询</MenuItem>
</MenuGroup>
</Submenu>
</Menu>

View File

@@ -0,0 +1,6 @@
import axios from 'axios'
//查询领料列表带库位
export const getListAndPost = (info) => {
return axios.get('/api/MaterialApp/ListAndPost', info)
}

View File

@@ -10,6 +10,7 @@ import inventorypoc from '@/views/inventory-poc.vue'
import Purchasesum from '@/views/Purchasesum.vue'
import inventoryrrival from '@/bill/inventory-arrival.vue'
import inventoryerror from '@/bill/inventory-error.vue'
import inventoryMaterialAppVouch from '@/views/inventory-materialAppVouch.vue'
export default [
{
@@ -29,4 +30,5 @@ export default [
{ path: '/Purchasesum', component: Purchasesum },
{ path: '/inventoryrrival', component: inventoryrrival },
{ path: '/inventoryerror', component: inventoryerror },
{ path: '/inventoryMaterialAppVouch', component: inventoryMaterialAppVouch },
]

View File

@@ -0,0 +1,490 @@
<template>
<div>
<h4>领料单</h4>
<div>
<Row :gutter="16">
<Col span="4">
<label>领料单号</label>
<Input autosize type="textarea" v-model="filter.ar_codes" />
</Col>
<Col span="4">
<label>物料编号</label>
<Input v-model="filter.inv_codes" />
</Col>
<Col span="4">
<Button
size="large"
type="primary"
icon="ios-search"
@click="handleClick"
>查询</Button
>
<Button size="large" type="success" @click="handelExport"
>导出</Button
>
</Col>
</Row>
</div>
<div id="tb">
<Table
style="margin-top: 20px"
:loading="loading"
size="small"
border
:columns="columnsMaterialAppVouch"
:data="pagedData"
>
</Table>
</div>
<Page
style="margin-top: 20px"
:current="pageNo"
:page-size="pageSize"
:total="total"
:page-size-opts="PageSizeOpts"
@on-change="handlePagechange"
@on-page-size-change="handlePageSize"
show-elevator
show-sizer
show-total
size="small"
/>
<Modal width="1366" v-model="modal1" title="单据详情" @on-cancel="cancel">
<Button size="large" type="primary" @click="print">打印</Button>
<div id="tb2">
<div>
<Row :gutter="16">
<Col span="7">
<label></label>
</Col>
<Col span="6">
<h1>采购到货单</h1>
</Col>
</Row>
</div>
<div>
<Row :gutter="16">
<Col span="8">
{{"领料单号:"+this.ccode}}
</Col>
<Col span="6">
{{"领料时间:"+this.ArrivalDate}}
</Col>
<Col span="4">
{{"业务员:"+this.cpersonname}}
</Col>
</Row>
</div>
<Table
style="margin-top: 20px"
height="700"
size="small"
border
:columns="columns2"
:data="datas2"
>
</Table>
</div>
</Modal>
</div>
</template>
<script>
//import vUpLoad from "@/bill/PrintView";
import { pageingData, export_col_to_excel, sortByKey } from "@/libs/tools";
import {getListAndPost} from "../api/materialAppVouch";
export default {
//components:{vUpLoad},
data() {
return {
loading: false,
PageSizeOpts: [10, 15, 20, 30],
pageNo: 1,
modal1: false,
printing: false,
strfilter: "",
multiple: false,
pageSize: 15,
datas: [],
ccode:"",
ArrivalDate:"",
cpersonname:"",
datas2: [],
filter: {
inv_codes: "",
inv_std: "",
ar_codes: "",
},
dom: "",
ranges: [
{
type: "price",
ccode: "",
// low: "", //区间的最小值
// height: "", //区间的最大值
},
],
columnsMaterialAppVouch: [
// {
// type: "index",
// title: "序号",
// width: 60,
// align: "center",
// },
{
title: "领料单号",
align: "center",
key: "app_vouch_order_no",
width: 150,
className: "demo-table-info-new",
},
{
title: "存货编码",
align: "center",
key: "material_code",
width: 110,
className: "demo-table-info-new",
},
{
title: "存货名称",
align: "center",
key: "material_name",
width: 130,
className: "demo-table-info-nom",
},
{
title: "规格型号",
align: "center",
key: "material_spec",
width: 135,
className: "demo-table-info-nom",
},
{
title: "单位",
align: "center",
key: "unit",
width: 80,
className: "demo-table-info-nom",
},
{
title: "数量",
align: "center",
key: "quantit",
width: 80,
className: "demo-table-info-nom",
},
{
title: "需求日期",
align: "center",
key: "demand_date",
width: 150,
className: "demo-table-info-nom",
},
{
title: "仓库",
align: "center",
key: "warehouse_name",
width: 150,
className: "demo-table-info-nom",
},
{
title: "生产单号",
align: "center",
key: "product_order_no",
width: 150,
className: "demo-table-info-nom",
},
{
title: "行号",
align: "center",
key: "product_order_line_no",
width: 70,
className: "demo-table-info-nom",
},
{
title: "产品编码",
align: "center",
key: "product_code",
width: 150,
className: "demo-table-info-nom",
},
{
title: "产品名称",
align: "center",
key: "product_name",
width: 150,
className: "demo-table-info-nom",
},
{
title: "产品规格",
align: "product_spec",
key: "Quantity",
width: 150,
className: "demo-table-info-nom",
},
{
title: "现存库位",
key: "position",
width: 160,
align: "left",
className: "demo-table-info-nom",
},
],
columns: [
{
title: "到货单号",
align: "center",
key: "ArrivalCode",
className: "demo-table-info-old",
render: (h, params) => {
return h("div", [
h(
"a",
{
props: {
type: "primary",
size: "small",
},
style: { color: "#2db7f5" },
domProps: {
title: params.row.ArrivalCode, //添加title属性
},
on: {
click: () => {
this.handleShow(params.row.ArrivalCode); //点击事件
},
},
},
params.row.ArrivalCode
),
]);
},
},
{
title: "到货日期",
align: "center",
key: "ArrivalDate",
},
{
title: "业务员",
align: "center",
key: "cpersonname",
},
{
title: "存货编码",
align: "center",
key: "MaterialCode",
},
{
title: "存货名称",
align: "center",
key: "cinvname",
},
{
title: "规格型号",
align: "center",
key: "cinvstd",
},
{
title: "单位",
align: "center",
key: "cinvm_unit",
},
{
title: "到货数量",
align: "center",
key: "Quantity",
},
{
title: "现存库位",
align: "center",
key: "cPosName",
width: 200,
},
],
columns2: [
{
title: "存货编码",
align: "center",
key: "MaterialCode",
width: 110,
className: "demo-table-info-new",
},
{
title: "存货名称",
align: "center",
key: "cinvname",
width: 130,
className: "demo-table-info-nom",
},
{
title: "规格型号",
align: "center",
key: "cinvstd",
width: 135,
className: "demo-table-info-nom",
},
{
title: "单位",
align: "center",
key: "cinvm_unit",
width: 80,
className: "demo-table-info-nom",
},
{
title: "数量",
align: "center",
key: "Quantity",
width: 80,
className: "demo-table-info-nom",
},
{
title: "现存库位",
key: "cPosName",
width: 160,
align: "left",
className: "demo-table-info-nom",
},
],
};
},
computed: {
total() {
return this.datas.length;
},
pagedData() {
return pageingData(this.datas, this.pageSize, this.pageNo);
},
},
mounted() {
this.loadData();
},
methods: {
handelExport() {
export_col_to_excel(this.columnsMaterialAppVouch, this.datas);
},
handleClick() {
this.loadData();
},
print() {
this.dom = document.getElementById("tb2");
// console.log(this.dom);
this.$print(this.dom);
},
inventory(ranges) {
const skus = new Array();
//筛选条件
this.datas.map((Item, index) => {
if (Item.ArrivalCode == this.ranges[0].ccode) {
skus.push({
...Item,
});
}
});
return skus;
},
cancel() {
this.datas2 = [];
this.modal1 = false;
},
async handleShow(h) {
this.ranges[0].ccode = h;
this.datas2 = this.inventory(this.ranges);
this.ccode=h;
this.ArrivalDate=this.datas2[0].ArrivalDate;
this.cpersonname=this.datas2[0].cpersonname;
this.modal1 = true;
},
async loadData() {
try {
let _filert = {
c_inv_code: this.filter.inv_codes,
inv_std: this.filter.inv_std,
arrival_nolist:
this.filter.ar_codes !== ""
? this.filter.ar_codes.split(/[,\s\n,]/)
: null,
};
this.loading = true;
let resp = await getListAndPost(_filert);
this.pageNo = 1;
this.datas = sortByKey(resp.data.data, "ArrivalCode");
// this.datas = resp.data.data;
} catch (error) {
} finally {
this.loading = false;
}
},
handlePagechange(page) {
this.pageNo = page;
},
handlePageSize(pageSize) {
this.pageSize = pageSize;
},
},
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style >
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
.ivu-table .demo-table-info-row td {
background-color: #2db7f5;
color: #fff;
}
.ivu-table .demo-table-error-row td {
background-color: #ff6600;
color: #fff;
}
.ivu-table td.demo-table-info-old {
color: #2db7f5;
}
.ivu-table td.demo-table-info-new {
color: #ff6600;
font-size: 12px;
}
.ivu-table td.demo-table-info-nom {
font-size: 11px;
}
.ivu-table td.demo-table-info-ex {
color: #187;
font-weight: 600;
}
body {
padding: 10px 1;
}
</style>