diff --git a/NX.ERP.Webapp/src/views/FilterTable.vue b/NX.ERP.Webapp/src/views/FilterTable.vue
new file mode 100644
index 0000000..adcd92b
--- /dev/null
+++ b/NX.ERP.Webapp/src/views/FilterTable.vue
@@ -0,0 +1,165 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/NX.ERP.Webapp/src/views/inventory-sale.vue b/NX.ERP.Webapp/src/views/inventory-sale.vue
index c39aa7d..c25f760 100644
--- a/NX.ERP.Webapp/src/views/inventory-sale.vue
+++ b/NX.ERP.Webapp/src/views/inventory-sale.vue
@@ -1,8 +1,9 @@
-
销售订单表
+
销售未发货明细表
+
-
+
+
+
+
+
+
+
+
+
-
+
+
+
import { getInventorySale } from "@/api/pmc";
+import FilterTable from "./FilterTable";
import {
pageingData,
export_col_to_excel,
@@ -63,7 +77,36 @@ import {
dateFormat,
sortByKey
} from "@/libs/tools";
+
+const isqj = {
+
+ 1: {
+ value: 1,
+ name: "是",
+ color: "red"
+ },
+ 2: {
+ value: 2,
+ name: "否",
+ color: "green"
+ }
+};
+const stateListq = {
+ 0: {
+ value: "1",
+ name: "15天内发货"
+ },
+ 1: {
+ value: "2",
+ name: "15天以上发货"
+ },
+ 2: {
+ value: "3",
+ name: "超期"
+ }
+};
export default {
+ components: { FilterTable },
data() {
return {
PageSizeOpts: [10, 15, 20, 30],
@@ -103,7 +146,10 @@ export default {
{
title: "客户",
align: "center",
- key: "cCusAbbName"
+ key: "cCusAbbName",
+ filter: {
+ type: "Input"
+ }
},
{
title: "订单日期",
@@ -111,82 +157,161 @@ export default {
key: "dDate",
render: (h, params) => {
return {dateFormat(params.row.dDate)}
;
+ },
+ filter: {
+ type: "Input"
}
},
{
title: "销售单号",
align: "center",
key: "cSOCode",
- width: "150"
+ width: "150",
+ filter: {
+ type: "Input"
+ }
},
{
title: "产品编码",
align: "center",
key: "cInvCode",
- className: "demo-table-info-new"
+ className: "demo-table-info-new",
+ filter: {
+ type: "Input"
+ }
},
{
title: "产品名称",
align: "center",
- key: "cInvName"
+ key: "cInvName",
+ filter: {
+ type: "Input"
+ }
},
{
title: "规格型号",
align: "center",
key: "cInvStd",
- width: "220"
+ width: "220",
+ filter: {
+ type: "Input"
+ }
},
{
title: "未发数量",
align: "center",
- key: "wfiQuantity"
+ key: "wfiQuantity",
+ filter: {
+ type: "Input"
+ }
},
{
title: "库存余量",
align: "center",
- key: "kcyl"
+ key: "kcyl",
+ filter: {
+ type: "Input"
+ }
},
{
title: "预计发货日期",
align: "center",
- key: "dPreDate"
+ key: "dPreDate",
+ filter: {
+ type: "Input"
+ }
},
{
title: "技术要求",
align: "center",
key: "cMemo",
- width: "300"
+ width: "300",
+ filter: {
+ type: "Input"
+ }
},
{
title: "时间预警",
align: "center",
key: "datewaring",
+ filter: {
+ type: "Select",
+ option: stateListq
+ }
},
{
title: "超期天数",
align: "center",
- key: "jandate"
+ key: "jandate",
+ filter: {
+ type: "Input"
+ }
},
{
title: "是否欠机",
align: "center",
- key: "kcyl",
+ key: "kcyl2",
render: (h, params) => {
return {this.Formatkcyl(params.row.kcyl)}
;
+ },
+ filter: {
+ type: "Select",
+ option: isqj
}
}
]
};
},
computed: {
+ filertData() {
+ let data = this.datas;
+ if (this.strfilter && this.strfilter !== "") {
+ let filterKey = this.strfilter
+ .toLowerCase()
+ .trim()
+ .split(/\s+/);
+ if (filterKey.length > 0) {
+ data = data.filter(item => {
+ return Object.keys(item).some(key => {
+ return filterKey.some(filter => {
+ return (
+ String(item[key])
+ .toLowerCase()
+ .indexOf(filter) > -1
+ );
+ });
+ });
+ });
+ }
+ }
+ return data;
+ },
+ usePage() {
+ if (this.page) {
+ return this.page;
+ } else {
+ return this.filertData.length > 15;
+ }
+ },
+ total() {
+ return this.filertData.length;
+ },
+ pagedData() {
+ if (this.usePage) {
+ return pageingData(this.filertData, this.pageSize, this.pageNo);
+ } else {
+ return this.filertData;
+ }
+ } /*
total() {
return this.datas.length;
},
pagedData() {
return pageingData(this.datas, this.pageSize, this.pageNo);
}
+ */
},
mounted() {
@@ -236,26 +361,67 @@ export default {
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'
- }
+ 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"
+ };
}
- else if (item.datewaring==="超期")
- {
- item.cellClassName= {
- datewaring: 'demo-table-info-cell-age'
- }
+ });
+ },
+ async onSearch(search) {
+ //模拟数据库查询数据
+ //这个search应该是传到后台,然后台来根据条件查询数据库
+ //alert("查询条件:" + JSON.stringify(search, null, 4));
+ //console.log(JSON.stringify(search, null, 4));
+
+ console.log(search);
+
+ let _filert = {
+ c_cus_abb_name: search.cCusAbbName,
+ d_date: search.dDate,
+ c_so_code: search.cSOCode,
+ c_inv_code: search.cInvCode,
+ c_inv_name: search.cInvName,
+ c_inv_std: search.cInvStd,
+ wfi_quantity: search.wfiQuantity,
+ kcyl: search.kcyl,
+ d_pre_date: search.dPreDate,
+ datewaring: search.datewaring,
+ c_memo: search.cMemo,
+ jandate: search.jandate,
+ kcyl2: search.kcyl2,
+
+
+ };
+
+ 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"
+ };
}
- else{
- item.cellClassName= {
- datewaring: 'demo-table-info-cell-name'
- }
- }
-
- })
+ });
},
handlePagechange(page) {