2021-10-19 16:05:46 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<h4>销售订单表</h4>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<Row :gutter="16">
|
|
|
|
|
|
<Col span="4">
|
|
|
|
|
|
<label>销售订单编号</label>
|
|
|
|
|
|
<Input v-model="filter.so_code" />
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
|
|
<Col span="4">
|
|
|
|
|
|
<label>物料编号</label>
|
|
|
|
|
|
<Input autosize type="textarea" v-model="filter.inv_codes" />
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
<Col span="4">
|
|
|
|
|
|
<label>规格</label>
|
|
|
|
|
|
<Input v-model="filter.inv_std" />
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
2021-10-20 11:20:38 +08:00
|
|
|
|
<Col span="4">
|
|
|
|
|
|
<label>时间预警</label>
|
2021-10-19 16:05:46 +08:00
|
|
|
|
<div>
|
|
|
|
|
|
<Select v-model="filter.flag" multiple>
|
|
|
|
|
|
<Option
|
|
|
|
|
|
v-for="item in stateList"
|
|
|
|
|
|
:value="item.value"
|
|
|
|
|
|
:key="item.value"
|
2021-10-20 11:20:38 +08:00
|
|
|
|
>{{ item.label }}</Option>
|
2021-10-19 16:05:46 +08:00
|
|
|
|
</Select>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</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>
|
|
|
|
|
|
|
2021-10-20 11:20:38 +08:00
|
|
|
|
<Table style="margin-top: 20px" size="small" border :columns="columns" :data="pagedData"></Table>
|
2021-10-19 16:05:46 +08:00
|
|
|
|
|
|
|
|
|
|
<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"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-10-20 11:20:38 +08:00
|
|
|
|
import { getInventorySale } from "@/api/pmc";
|
|
|
|
|
|
import {
|
|
|
|
|
|
pageingData,
|
|
|
|
|
|
export_col_to_excel,
|
|
|
|
|
|
dateFormatFull,
|
|
|
|
|
|
dateFormat,
|
|
|
|
|
|
sortByKey
|
|
|
|
|
|
} from "@/libs/tools";
|
2021-10-19 16:05:46 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
PageSizeOpts: [10, 15, 20, 30],
|
|
|
|
|
|
pageNo: 1,
|
2021-10-20 11:20:38 +08:00
|
|
|
|
strfilter: "",
|
2021-10-19 16:05:46 +08:00
|
|
|
|
multiple: false,
|
|
|
|
|
|
pageSize: 15,
|
|
|
|
|
|
datas: [],
|
|
|
|
|
|
filter: {
|
2021-10-20 11:20:38 +08:00
|
|
|
|
inv_codes: "",
|
|
|
|
|
|
inv_std: "",
|
|
|
|
|
|
so_code: "",
|
2021-10-19 16:05:46 +08:00
|
|
|
|
dates: [],
|
|
|
|
|
|
flag: []
|
|
|
|
|
|
},
|
2021-10-20 11:20:38 +08:00
|
|
|
|
stateList: [
|
2021-10-19 16:05:46 +08:00
|
|
|
|
{
|
|
|
|
|
|
value: "1",
|
2021-10-20 11:20:38 +08:00
|
|
|
|
label: "15天内发货"
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: "2",
|
2021-10-20 11:20:38 +08:00
|
|
|
|
label: "15天以上发货"
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
value: "3",
|
2021-10-20 11:20:38 +08:00
|
|
|
|
label: "超期"
|
|
|
|
|
|
}
|
2021-10-19 16:05:46 +08:00
|
|
|
|
],
|
|
|
|
|
|
columns: [
|
|
|
|
|
|
{
|
2021-10-20 11:20:38 +08:00
|
|
|
|
type: "index",
|
|
|
|
|
|
title: "序号",
|
|
|
|
|
|
width: 65,
|
|
|
|
|
|
align: "center"
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2021-10-20 11:20:38 +08:00
|
|
|
|
title: "客户",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
key: "cCusAbbName"
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2021-10-20 11:20:38 +08:00
|
|
|
|
title: "订单日期",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
key: "dDate",
|
2021-10-19 16:05:46 +08:00
|
|
|
|
render: (h, params) => {
|
2021-10-20 11:20:38 +08:00
|
|
|
|
return <div> {dateFormat(params.row.dDate)} </div>;
|
2021-10-19 16:05:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
2021-10-20 11:20:38 +08:00
|
|
|
|
title: "销售单号",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
key: "cSOCode",
|
|
|
|
|
|
width: "150"
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
2021-10-20 11:20:38 +08:00
|
|
|
|
|
2021-10-19 16:05:46 +08:00
|
|
|
|
{
|
2021-10-20 11:20:38 +08:00
|
|
|
|
title: "产品编码",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
key: "cInvCode",
|
|
|
|
|
|
className: "demo-table-info-new"
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2021-10-20 11:20:38 +08:00
|
|
|
|
title: "产品名称",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
key: "cInvName"
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2021-10-20 11:20:38 +08:00
|
|
|
|
title: "规格型号",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
key: "cInvStd",
|
|
|
|
|
|
width: "220"
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2021-10-20 11:20:38 +08:00
|
|
|
|
title: "未发数量",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
key: "wfiQuantity"
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2021-10-20 11:20:38 +08:00
|
|
|
|
title: "库存余量",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
key: "kcyl"
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2021-10-20 11:20:38 +08:00
|
|
|
|
title: "预计发货日期",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
key: "dPreDate"
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
2021-10-20 11:20:38 +08:00
|
|
|
|
|
2021-10-19 16:05:46 +08:00
|
|
|
|
{
|
2021-10-20 11:20:38 +08:00
|
|
|
|
title: "技术要求",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
key: "cMemo",
|
|
|
|
|
|
width: "300"
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2021-10-20 11:20:38 +08:00
|
|
|
|
title: "时间预警",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
key: "datewaring",
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2021-10-20 11:20:38 +08:00
|
|
|
|
title: "超期天数",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
key: "jandate"
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2021-10-20 11:20:38 +08:00
|
|
|
|
title: "是否欠机",
|
|
|
|
|
|
align: "center",
|
|
|
|
|
|
key: "kcyl",
|
|
|
|
|
|
render: (h, params) => {
|
|
|
|
|
|
return <div> {this.Formatkcyl(params.row.kcyl)} </div>;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-10-19 16:05:46 +08:00
|
|
|
|
]
|
2021-10-20 11:20:38 +08:00
|
|
|
|
};
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
total() {
|
2021-10-20 11:20:38 +08:00
|
|
|
|
return this.datas.length;
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
pagedData() {
|
2021-10-20 11:20:38 +08:00
|
|
|
|
return pageingData(this.datas, this.pageSize, this.pageNo);
|
2021-10-19 16:05:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
mounted() {
|
2021-10-20 11:20:38 +08:00
|
|
|
|
this.loadData();
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
handelExport() {
|
2021-10-20 11:20:38 +08:00
|
|
|
|
export_col_to_excel(this.columns, this.datas);
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
handleClick() {
|
2021-10-20 11:20:38 +08:00
|
|
|
|
this.loadData();
|
|
|
|
|
|
},
|
|
|
|
|
|
Formatkcyl(kcyl) {
|
|
|
|
|
|
if (kcyl > 0) {
|
|
|
|
|
|
return "否";
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return "是";
|
|
|
|
|
|
}
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
async loadData() {
|
2021-10-20 11:20:38 +08:00
|
|
|
|
let _beginDate = null;
|
|
|
|
|
|
let _endDate = null;
|
|
|
|
|
|
if (
|
|
|
|
|
|
this.filter.dates.length == 2 &&
|
|
|
|
|
|
this.filter.dates[0] !== "" &&
|
|
|
|
|
|
this.filter.dates[0] !== ""
|
|
|
|
|
|
) {
|
|
|
|
|
|
_beginDate = this.filter.dates[0];
|
|
|
|
|
|
_endDate = this.filter.dates[1];
|
2021-10-19 16:05:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let _filert = {
|
2021-10-20 11:20:38 +08:00
|
|
|
|
inv_codes:
|
|
|
|
|
|
this.filter.inv_codes !== ""
|
|
|
|
|
|
? this.filter.inv_codes.split(/[,\s\n,]/)
|
|
|
|
|
|
: null,
|
2021-10-19 16:05:46 +08:00
|
|
|
|
inv_std: this.filter.inv_std,
|
2021-10-20 11:20:38 +08:00
|
|
|
|
so_codes:
|
|
|
|
|
|
this.filter.so_code !== ""
|
|
|
|
|
|
? this.filter.so_code.split(/[,\s\n,]/)
|
|
|
|
|
|
: null,
|
2021-10-19 16:05:46 +08:00
|
|
|
|
begin_date: _beginDate,
|
|
|
|
|
|
end_date: _endDate,
|
|
|
|
|
|
flag: this.filter.flag
|
2021-10-20 11:20:38 +08:00
|
|
|
|
};
|
|
|
|
|
|
let resp = await getInventorySale(_filert);
|
|
|
|
|
|
this.pageNo = 1;
|
|
|
|
|
|
this.datas = resp.data.data;
|
|
|
|
|
|
this.datas = sortByKey(resp.data.data, "dDate");
|
|
|
|
|
|
this.datas.forEach((item) => {
|
|
|
|
|
|
if(item.datewaring==="15天内发货")
|
|
|
|
|
|
{
|
|
|
|
|
|
item.cellClassName= {
|
|
|
|
|
|
datewaring: 'demo-table-info-cell-address'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (item.datewaring==="超期")
|
|
|
|
|
|
{
|
|
|
|
|
|
item.cellClassName= {
|
|
|
|
|
|
datewaring: 'demo-table-info-cell-age'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else{
|
|
|
|
|
|
item.cellClassName= {
|
|
|
|
|
|
datewaring: 'demo-table-info-cell-name'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
})
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
handlePagechange(page) {
|
2021-10-20 11:20:38 +08:00
|
|
|
|
this.pageNo = page;
|
2021-10-19 16:05:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
handlePageSize(pageSize) {
|
2021-10-20 11:20:38 +08:00
|
|
|
|
this.pageSize = pageSize;
|
2021-10-19 16:05:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-10-20 11:20:38 +08:00
|
|
|
|
};
|
2021-10-19 16:05:46 +08:00
|
|
|
|
</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;
|
|
|
|
|
|
}
|
|
|
|
|
|
.ivu-table td.demo-table-info-ex {
|
|
|
|
|
|
color: #187;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
2021-10-20 11:20:38 +08:00
|
|
|
|
|
|
|
|
|
|
.ivu-table .demo-table-info-cell-name {
|
|
|
|
|
|
background-color: #2db7f5;
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
}
|
|
|
|
|
|
.ivu-table .demo-table-info-cell-age {
|
|
|
|
|
|
background-color: #ff6600;
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
}
|
|
|
|
|
|
.ivu-table .demo-table-info-cell-address {
|
|
|
|
|
|
background-color: #187;
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
}
|
2021-10-19 16:05:46 +08:00
|
|
|
|
body {
|
|
|
|
|
|
padding: 10px 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|