This commit is contained in:
gongxh
2021-12-07 15:50:46 +08:00
10 changed files with 904 additions and 88 deletions

View File

@@ -87,8 +87,9 @@
<Compile Include="Request\Stock.cs" /> <Compile Include="Request\Stock.cs" />
<Compile Include="Request\Userrequest.cs" /> <Compile Include="Request\Userrequest.cs" />
<Compile Include="Response\MOM\Bom.cs" /> <Compile Include="Response\MOM\Bom.cs" />
<Compile Include="Response\Pmc\PmcWwInvlRes.cs" />
<Compile Include="Response\Pmc\PmcInventoryallRes.cs" /> <Compile Include="Response\Pmc\PmcInventoryallRes.cs" />
<Compile Include="Response\Pmc\PmcWwInvlRes.cs" />
<Compile Include="Response\Pmc\PmcInventoryallsaleRes.cs" />
<Compile Include="Response\Pmc\PmcInventorymomRes.cs" /> <Compile Include="Response\Pmc\PmcInventorymomRes.cs" />
<Compile Include="Response\Qmcheck\Qmcheckvoucher.cs" /> <Compile Include="Response\Qmcheck\Qmcheckvoucher.cs" />
<Compile Include="Response\Store\MaterialApp.cs" /> <Compile Include="Response\Store\MaterialApp.cs" />

View File

@@ -0,0 +1,178 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
namespace NX.ERP.Model
{
public class PmcInventoryallsaleRes : BaseModel
{
private string cCusAbbName;
private string dDate;
private string cSoCode;
private string cInvCode;
private string cInvName;
private string cInvStd;
private string wfiQuantity;
private string cCloser;
private string xcl;
private string cVerifier;
private string kcyl;
private string dPreDate;
private string cMemo;
private string datewaring;
private int jandate;
/// <summary>
///
/// </summary>
public string CCusAbbName
{
get { return this.cCusAbbName; }
set { this.cCusAbbName = value; }
}
/// <summary>
///
/// </summary>
public string DDate
{
get { return this.dDate; }
set { this.dDate = value; }
}
/// <summary>
///
/// </summary>
public string CSoCode
{
get { return this.cSoCode; }
set { this.cSoCode = value; }
}
/// <summary>
///
/// </summary>
public string CInvCode
{
get { return this.cInvCode; }
set { this.cInvCode = value; }
}
/// <summary>
///
/// </summary>
public string CInvName
{
get { return this.cInvName; }
set { this.cInvName = value; }
}
/// <summary>
///
/// </summary>
public string CInvStd
{
get { return this.cInvStd; }
set { this.cInvStd = value; }
}
/// <summary>
///
/// </summary>
public string WfiQuantity
{
get { return this.wfiQuantity; }
set { this.wfiQuantity = value; }
}
/// <summary>
///
/// </summary>
public string CCloser
{
get { return this.cCloser; }
set { this.cCloser = value; }
}
/// <summary>
///
/// </summary>
public string Xcl
{
get { return this.xcl; }
set { this.xcl = value; }
}
/// <summary>
///
/// </summary>
public string CVerifier
{
get { return this.cVerifier; }
set { this.cVerifier = value; }
}
/// <summary>
///
/// </summary>
public string Kcyl
{
get { return this.kcyl; }
set { this.kcyl = value; }
}
/// <summary>
///
/// </summary>
public string DPreDate
{
get { return this.dPreDate; }
set { this.dPreDate = value; }
}
/// <summary>
///
/// </summary>
public string CMemo
{
get { return this.cMemo; }
set { this.cMemo = value; }
}
/// <summary>
///
/// </summary>
public string Datewaring
{
get { return this.datewaring; }
set { this.datewaring = value; }
}
/// <summary>
///
/// </summary>
public int Jandate
{
get { return this.jandate; }
set { this.jandate = value; }
}
}
public class saleRes
{
public long sumWfiQuantity { get; set; }
public IEnumerable<PmcInventoryallsaleRes> wfdetails { get; set; }
}
public class Wfsum
{
public int wf { get; set; }
public int xcl { get; set; }
}
}

View File

@@ -852,15 +852,15 @@ select *from tempdb..tablepzck20210526
} }
public IEnumerable<object> InventorySale(NX.ERP.Model.Request.SaleinvRequest info1) public NX.ERP.Model.saleRes InventorySale(NX.ERP.Model.Request.SaleinvRequest info1)
{ {
string sql = $@" string sql = $@"
select *from ( select *from (
select f.cCusAbbName,CONVERT(varchar(100),b.dDate, 23) as dDate ,b.cSOCode,a.cInvCode,a.cInvName,g.cInvStd, a.iQuantity - isnull(d.cqty,0) as wfiQuantity,b.cCloser select f.cCusAbbName,CONVERT(varchar(100),b.dDate, 23) as dDate ,b.cSOCode,a.cInvCode,a.cInvName,g.cInvStd, FLOOR(a.iQuantity - isnull(d.cqty,0)) as wfiQuantity,b.cCloser
, ,
isnull(cs.qty,0) as xcl, FLOOR(isnull(cs.qty,0)) as xcl,
b.cVerifier b.cVerifier
,case when ( ,FLOOR(case when (
isnull( isnull(
(SELECT isnull(SUM(iquantity),0) qty (SELECT isnull(SUM(iquantity),0) qty
FROM currentstock WITH (nolock) where cInvCode=a.cInvCode FROM currentstock WITH (nolock) where cInvCode=a.cInvCode
@@ -884,7 +884,7 @@ select *from tempdb..tablepzck20210526
GROUP BY ipesodid) dd on isnull(dd.ipesodid,'')=isnull(aa.iSOsID ,'') GROUP BY ipesodid) dd on isnull(dd.ipesodid,'')=isnull(aa.iSOsID ,'')
where aa.cInvCode=a.cInvCode and isnull( bb.cCloser ,'') =''and bb.cVerifier is not null and isnull(CONVERT(varchar(100),aa.dPreDate, 23),'1900-01-01')<=isnull(CONVERT(varchar(100),a.dPreDate, 23),'1900-01-01') and (aa.iQuantity - isnull(dd.cqty,0))>0 where aa.cInvCode=a.cInvCode and isnull( bb.cCloser ,'') =''and bb.cVerifier is not null and isnull(CONVERT(varchar(100),aa.dPreDate, 23),'1900-01-01')<=isnull(CONVERT(varchar(100),a.dPreDate, 23),'1900-01-01') and (aa.iQuantity - isnull(dd.cqty,0))>0
group by aa.cInvCode group by aa.cInvCode
) ) end as kcyl ) ) end )as kcyl
, ,
CONVERT(varchar(100),a.dPreDate, 23) as dPreDate , a.cMemo, CONVERT(varchar(100),a.dPreDate, 23) as dPreDate , a.cMemo,
CASE CASE
@@ -908,6 +908,7 @@ select *from tempdb..tablepzck20210526
left join Inventory g WITH (nolock) on g.cInvCode=a.cInvCode ) mm left join Inventory g WITH (nolock) on g.cInvCode=a.cInvCode ) mm
@@ -996,14 +997,18 @@ select *from tempdb..tablepzck20210526
{ {
if (info1.kcyl2 == "1") if (info1.kcyl2 == "1")
{ {
where.Add(" mm.kcyl <= 0 "); where.Add(" mm.kcyl < 0 ");
} }
else if (info1.kcyl2 == "2") if (info1.kcyl2 == "2")
{ {
where.Add(" mm.kcyl > 0 "); where.Add(" mm.kcyl >= 0 ");
}
else if (info1.kcyl2 == "3")
{
where.Add(" 1=1 ");
} }
} }
if (!string.IsNullOrEmpty(info1.datewaring)) if (!string.IsNullOrEmpty(info1.datewaring))
{ {
@@ -1080,10 +1085,32 @@ select *from tempdb..tablepzck20210526
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection) using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
{ {
try { return conn.Query<object>(sql, new { cCusAbbName = $"%{info1.cCusAbbName}%", dDate = info1.dDate, dPreDate = info1.dPreDate, cSOCode = $"%{info1.cSOCode}%" , cInvCode = $"%{info1.cInvCode}%", cInvName = $"%{info1.cInvName}%", cInvStd = $"%{info1.cInvStd}%", cMemo = $"%{info1.cMemo}%", SoCodes = info1.SoCodes, info1.jandate, info1.wfiQuantity, info1.kcyl, }); } var res= conn.Query<NX.ERP.Model.PmcInventoryallsaleRes>(sql, new { cCusAbbName = $"%{info1.cCusAbbName}%", dDate = info1.dDate, dPreDate = info1.dPreDate, cSOCode = $"%{info1.cSOCode}%" , cInvCode = $"%{info1.cInvCode}%", cInvName = $"%{info1.cInvName}%", cInvStd = $"%{info1.cInvStd}%", cMemo = $"%{info1.cMemo}%", SoCodes = info1.SoCodes, info1.jandate, info1.wfiQuantity, info1.kcyl, });
catch { return null; }
var resall = new NX.ERP.Model.saleRes();
resall.wfdetails = res;
var a1 = res.Sum(m =>long.Parse( m.WfiQuantity));
var a2 = res.GroupBy(m => m.CInvCode);//.Sum(m=>m.Max(n=>long.Parse(n.Xcl)));
resall.sumWfiQuantity = 0;
foreach (var item in a2)
{
var xuq = item.Sum(m => long.Parse( m.WfiQuantity));
var kucun = item.Max(m =>long.Parse( m.Xcl));
resall.sumWfiQuantity += Math.Min(kucun - xuq, 0);
}
return resall;
} }
} }
public IEnumerable<object> InventoryPo(NX.ERP.Model.Request.PoOrderRequest info1) public IEnumerable<object> InventoryPo(NX.ERP.Model.Request.PoOrderRequest info1)

View File

@@ -47,10 +47,14 @@ namespace NX.ERP.WebAPi.Controllers
[HttpPost] [HttpPost]
[Route("api/Pmc/InventorySale")] [Route("api/Pmc/InventorySale")]
public IEnumerable<object> InventorySale(NX.ERP.Model.Request.SaleinvRequest info1) public NX.ERP.Model.saleRes InventorySale(NX.ERP.Model.Request.SaleinvRequest info1)
{ {
var PmcQuery = new NX.ERP.U8.Pmc.PmcQuery(); var PmcQuery = new NX.ERP.U8.Pmc.PmcQuery();
return PmcQuery.InventorySale(info1); var aa= PmcQuery.InventorySale(info1);
aa.wfdetails = aa.wfdetails.OrderBy(m => m.CInvCode).ThenBy(m => m.CInvStd).ThenBy(m => m.DPreDate);
return aa;
} }
[Obsolete] [Obsolete]
[HttpPost] [HttpPost]

View File

@@ -7627,8 +7627,8 @@
}, },
"lodash": { "lodash": {
"version": "4.17.21", "version": "4.17.21",
"resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.21.tgz?cache=0&sync_timestamp=1613835817439&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash%2Fdownload%2Flodash-4.17.21.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha1-Z5WRxWTDv/quhFTPCz3zcMPWkRw=" "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
}, },
"lodash.debounce": { "lodash.debounce": {
"version": "4.0.8", "version": "4.0.8",

View File

@@ -6,21 +6,23 @@
<Icon type="ios-stats" />ERP查询 <Icon type="ios-stats" />ERP查询
</template> </template>
<MenuGroup title="报表"> <MenuGroup title="报表">
<MenuItem to="/inventorysale" name="3-5">销售未发明细表</MenuItem>
<!-- <MenuItem to="/inventory" name="3-2">物料在途在制查询表</MenuItem> <!-- <MenuItem to="/inventory" name="3-2">物料在途在制查询表</MenuItem>
<MenuItem to="/inventoryMom" name="3-3">跟单记录表</MenuItem> <MenuItem to="/inventoryMom" name="3-3">跟单记录表</MenuItem>
<MenuItem to="/InventoryMonth" name="3-4">材料出库数据与品种</MenuItem> <MenuItem to="/InventoryMonth" name="3-4">材料出库数据与品种</MenuItem>
<MenuItem to="/inventorypo" name="3-8">采购订单列表(PMC)</MenuItem> <MenuItem to="/inventorypo" name="3-8">采购订单列表(PMC)</MenuItem>
<MenuItem to="/inventorysale" name="3-5">销售未发明细表</MenuItem>
<MenuItem to="/InventorySo" name="3-5">销售订单表</MenuItem>--> <MenuItem to="/InventorySo" name="3-5">销售订单表</MenuItem>
<MenuItem to="/inventory-SNDetail" name="3-6">序列号查询</MenuItem> <MenuItem to="/inventory-SNDetail" name="3-6">序列号查询</MenuItem>
<MenuItem to="/inventorybu" name="3-7">补料量查询</MenuItem> <MenuItem to="/inventorybu" name="3-7">补料量查询</MenuItem>
<MenuItem to="/inventorypoc" name="3-9">采购跟进表(采购部)</MenuItem> <MenuItem to="/inventorypoc" name="3-9">采购跟进表(采购部)</MenuItem>
<MenuItem to="/Purchasesum" name="3-99">采购查询汇总</MenuItem> <MenuItem to="/Purchasesum" name="3-99">采购查询汇总</MenuItem>
-->
</MenuGroup> </MenuGroup>
</Submenu> </Submenu>
<!--
<Submenu name="4"> <Submenu name="4">
<template slot="title"> <template slot="title">
<Icon type="ios-stats" />ERP单据 <Icon type="ios-stats" />ERP单据
@@ -33,6 +35,7 @@
<MenuItem to="/inventoryQmerror" name="4-5">不良品处理问题单据</MenuItem> <MenuItem to="/inventoryQmerror" name="4-5">不良品处理问题单据</MenuItem>
</MenuGroup> </MenuGroup>
</Submenu> </Submenu>
-->
</Menu> </Menu>
<div class="contain"> <div class="contain">
<router-view></router-view> <router-view></router-view>

View File

@@ -5,10 +5,10 @@
<Table <Table
:show-header="false" :show-header="false"
border border
height="820" height="800"
:data="data" :data="data"
:columns="columns" :columns="columns"
show-summary show-summary
show-context-menu show-context-menu
:summary-method="handleSummary" :summary-method="handleSummary"
></Table> ></Table>
@@ -20,7 +20,9 @@ export default {
name: "FilterTable", name: "FilterTable",
props: { props: {
columns: Array, //列描述数据对象 columns: Array, //列描述数据对象
data: Array //表格数据 data: Array, //表格数据
wf: Number
}, },
computed: { computed: {
/* /*
@@ -237,6 +239,15 @@ export default {
}; };
return; return;
} }
if (column.wfsum == true) {
console.log(this.wf)
sums[key] = {
key,
value: this.wf
};
return;
}
if (column.issum != true) { if (column.issum != true) {
sums[key] = { sums[key] = {
key, key,

View File

@@ -0,0 +1,552 @@
<template>
<div>
<h2>销售未发货明细表</h2>
<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>
<div>
<Select v-model="filter.flag" multiple>
<Option
v-for="item in stateList"
:value="item.value"
:key="item.value"
>{{ item.label }}</Option>
</Select>
</div>
</Col>
-->
<Col span="4">
<div class="search_div">
<i-input
@on-change="pageNo=1"
clearable
placeholder="输入关键词筛选,多个用空格分隔"
v-model="strfilter"
>
<Icon slot="suffix" type="ios-search" />
</i-input>
</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>
<!--<Table style="margin-top: 20px" size="small" border :columns="columns" :data="pagedData"></Table>-->
<filter-table @on-search="onSearch" :data="pagedData" :columns="columns"></filter-table>
<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>
import { getInventorySale } from "@/api/pmc";
import FilterTable from "./FilterTable";
import {
pageingData,
export_col_to_excel,
dateFormatFull,
dateFormat,
sortByKey
} from "@/libs/tools";
const isqj = {
1: {
value: 1,
name: "是",
color: "red"
},
2: {
value: 2,
name: "否",
color: "green"
},
3: {
value: 3,
name: "全",
color: "blue"
}
};
const stateListq = {
0: {
value: "1",
name: "15天内发货"
},
1: {
value: "2",
name: "15天以上发货"
},
2: {
value: "3",
name: "超期"
}
};
export default {
components: { FilterTable },
data() {
return {
PageSizeOpts: [9999],
pageNo: 1,
strfilter: "",
multiple: false,
pageSize: 9999,
datas: [],
filter: {
inv_codes: "",
inv_std: "",
so_code: "",
dates: [],
flag: []
},
stateList: [
{
value: "1",
label: "15天内发货"
},
{
value: "2",
label: "15天以上发货"
},
{
value: "3",
label: "超期"
}
],
columns: [
{
type: "index",
title: "序号",
width: 70,
align: "center"
},
{
title: "客户",
align: "center",
key: "c_cus_abb_name",
width: 145,
filter: {
type: "AutoComplete"
}
},
{
title: "订单日期",
align: "center",
width: 140,
key: "d_date",
render: (h, params) => {
return <div> {dateFormat(params.row.d_date)} </div>;
},
filter: {
type: "DatePicker"
}
},
{
title: "销售单号",
align: "center",
key: "c_so_code",
width: "160",
filter: {
type: "AutoComplete"
}
},
{
title: "产品编码",
align: "center",
key: "c_inv_code",
width: "120",
className: "demo-table-info-new",
filter: {
type: "AutoComplete"
}
},
{
title: "产品名称",
align: "center",
width: "150",
key: "c_inv_name",
filter: {
type: "AutoComplete"
}
},
{
title: "规格型号",
align: "center",
key: "c_inv_std",
width: "180",
filter: {
type: "AutoComplete",
}
},
{
title: "未发数量",
align: "center",
width: "100",
issum:true,
key: "wfi_quantity",
filter: {
type: "Input"
}
},
{
title: "现存量",
align: "center",
width: "100",
key: "xcl",
filter: {
type: "Input"
}
},
{
title: "欠货量",
align: "center",
width: "100",
issum:true,
key: "kcyl",
filter: {
type: "Input"
}
},
{
title: "预计发货日期",
align: "center",
width: 140,
key: "d_pre_date",
filter: {
type: "DatePicker"
}
},
{
title: "技术要求",
align: "center",
key: "c_memo",
width: "280",
filter: {
type: "Input"
}
},
{
title: "时间预警",
align: "center",
width: 130,
key: "datewaring",
filter: {
type: "Select",
option: stateListq
}
},
{
title: "超期天数",
align: "center",
key: "jandate",
width: "120",
filter: {
type: "Input"
}
},
{
title: "是否欠机",
align: "center",
width: "120",
key: "kcyl2",
render: (h, params) => {
return <div> {this.Formatkcyl(params.row.kcyl)} </div>;
},
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() {
this.loadData();
},
methods: {
handelExport() {
export_col_to_excel(this.columns, this.datas);
},
handleClick() {
this.loadData();
},
Formatkcyl(kcyl) {
if (kcyl < 0) {
return "是";
} else {
return "否";
}
},
async loadData() {
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];
}
let _filert = {
inv_codes:
this.filter.inv_codes !== ""
? this.filter.inv_codes.split(/[,\s\n,]/)
: null,
inv_std: this.filter.inv_std,
so_codes:
this.filter.so_code !== ""
? this.filter.so_code.split(/[,\s\n,]/)
: null,
begin_date: _beginDate,
end_date: _endDate,
flag: this.filter.flag
};
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"
};
}
});
},
async onSearch(search) {
//模拟数据库查询数据
//这个search应该是传到后台,然后台来根据条件查询数据库
//alert("查询条件:" + JSON.stringify(search, null, 4));
//console.log(JSON.stringify(search, null, 4));
//console.log(search);
if (JSON.stringify(search.c_cus_abb_name) == "{}") {
search.c_cus_abb_name = "";
}
if (JSON.stringify(search.c_so_code) == "{}") {
search.c_so_code = "";
}
if (JSON.stringify(search.c_inv_code) == "{}") {
search.c_inv_code = "";
}
if (JSON.stringify(search.c_inv_name) == "{}") {
search.c_inv_name = "";
}
if (JSON.stringify(search.c_inv_std) == "{}") {
search.c_inv_std = "";
}
if (JSON.stringify(search.wfi_quantity) == "{}") {
search.wfi_quantity = "";
}
if (JSON.stringify(search.kcyl) == "{}") {
search.kcyl = "";
}
if (JSON.stringify(search.datewaring) == "{}") {
search.datewaring = "";
}
if (JSON.stringify(search.c_memo) == "{}") {
search.c_memo = "";
}
let _filert = {
c_cus_abb_name: search.c_cus_abb_name,
d_date: search.d_date,
c_so_code: search.c_so_code,
c_inv_code: search.c_inv_code,
c_inv_name: search.c_inv_name,
c_inv_std: search.c_inv_std,
wfi_quantity: search.wfi_quantity,
kcyl: search.kcyl,
d_pre_date: search.d_pre_date,
datewaring: search.datewaring,
c_memo: search.c_memo,
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"
};
}
});
},
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;
}
.ivu-table td.demo-table-info-ex {
color: #187;
font-weight: 600;
}
.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;
}
body {
padding: 10px 1;
}
.ivu-select-dropdown-transfer {
width: 165px;
max-height: 160px;
}
.ivu-auto-complete.ivu-select-dropdown {
max-height: 500px;
}
</style>

View File

@@ -49,7 +49,7 @@
<!--<Table style="margin-top: 20px" size="small" border :columns="columns" :data="pagedData"></Table>--> <!--<Table style="margin-top: 20px" size="small" border :columns="columns" :data="pagedData"></Table>-->
<filter-table @on-search="onSearch" :data="pagedData" :columns="columns"></filter-table> <filter-table @on-search="onSearch" :data="pagedData" :columns="columns" :wf="qhsum" ></filter-table>
<Page <Page
style="margin-top: 20px" style="margin-top: 20px"
@@ -69,6 +69,7 @@
<script> <script>
import { getInventorySale } from "@/api/pmc"; import { getInventorySale } from "@/api/pmc";
import debounce from "lodash/debounce";
import FilterTable from "./FilterTable"; import FilterTable from "./FilterTable";
import { import {
pageingData, pageingData,
@@ -88,6 +89,11 @@ const isqj = {
value: 2, value: 2,
name: "否", name: "否",
color: "green" color: "green"
},
3: {
value: 3,
name: "全",
color: "blue"
} }
}; };
const stateListq = { const stateListq = {
@@ -112,7 +118,10 @@ export default {
pageNo: 1, pageNo: 1,
strfilter: "", strfilter: "",
multiple: false, multiple: false,
searchText: {},
pageSize: 9999, pageSize: 9999,
temp: 1,
qhsum:0,
datas: [], datas: [],
filter: { filter: {
inv_codes: "", inv_codes: "",
@@ -145,7 +154,7 @@ export default {
{ {
title: "客户", title: "客户",
align: "center", align: "center",
key: "cCusAbbName", key: "c_cus_abb_name",
width: 145, width: 145,
filter: { filter: {
type: "AutoComplete" type: "AutoComplete"
@@ -154,10 +163,10 @@ export default {
{ {
title: "订单日期", title: "订单日期",
align: "center", align: "center",
width: 145, width: 140,
key: "dDate", key: "d_date",
render: (h, params) => { render: (h, params) => {
return <div> {dateFormat(params.row.dDate)} </div>; return <div> {dateFormat(params.row.d_date)} </div>;
}, },
filter: { filter: {
type: "DatePicker" type: "DatePicker"
@@ -166,7 +175,7 @@ export default {
{ {
title: "销售单号", title: "销售单号",
align: "center", align: "center",
key: "cSOCode", key: "c_so_code",
width: "160", width: "160",
filter: { filter: {
type: "AutoComplete" type: "AutoComplete"
@@ -176,18 +185,18 @@ export default {
{ {
title: "产品编码", title: "产品编码",
align: "center", align: "center",
key: "cInvCode", key: "c_inv_code",
width: "120", width: "120",
className: "demo-table-info-new", className: "demo-table-info-new",
filter: { filter: {
type: "Input" type: "AutoComplete"
} }
}, },
{ {
title: "产品名称", title: "产品名称",
align: "center", align: "center",
width: "150", width: "150",
key: "cInvName", key: "c_inv_name",
filter: { filter: {
type: "AutoComplete" type: "AutoComplete"
} }
@@ -195,27 +204,18 @@ export default {
{ {
title: "规格型号", title: "规格型号",
align: "center", align: "center",
key: "cInvStd", key: "c_inv_std",
width: "220", width: "180",
filter: { filter: {
type: "AutoComplete", type: "AutoComplete"
} }
}, },
{ {
title: "未发数量", title: "未发数量",
align: "center", align: "center",
width: "120", width: "100",
issum:true, issum: true,
key: "wfiQuantity", key: "wfi_quantity",
filter: {
type: "Input"
}
},
{
title: "欠货量",
align: "center",
width: "120",
key: "kcyl",
filter: { filter: {
type: "Input" type: "Input"
} }
@@ -223,17 +223,27 @@ export default {
{ {
title: "现存量", title: "现存量",
align: "center", align: "center",
width: "120", width: "100",
key: "xcl", key: "xcl",
filter: { filter: {
type: "Input" type: "Input"
} }
}, },
{
title: "欠货量",
align: "center",
width: "100",
wfsum: true,
key: "kcyl",
filter: {
type: "Input"
}
},
{ {
title: "预计发货日期", title: "预计发货日期",
align: "center", align: "center",
width: 145, width: 140,
key: "dPreDate", key: "d_pre_date",
filter: { filter: {
type: "DatePicker" type: "DatePicker"
} }
@@ -242,8 +252,8 @@ export default {
{ {
title: "技术要求", title: "技术要求",
align: "center", align: "center",
key: "cMemo", key: "c_memo",
width: "300", width: "280",
filter: { filter: {
type: "Input" type: "Input"
} }
@@ -344,10 +354,10 @@ export default {
this.loadData(); this.loadData();
}, },
Formatkcyl(kcyl) { Formatkcyl(kcyl) {
if (kcyl > 0) { if (kcyl < 0) {
return "否";
} else {
return "是"; return "是";
} else {
return "否";
} }
}, },
async loadData() { async loadData() {
@@ -378,8 +388,9 @@ export default {
}; };
let resp = await getInventorySale(_filert); let resp = await getInventorySale(_filert);
this.pageNo = 1; this.pageNo = 1;
this.datas = resp.data.data; this.datas = resp.data.data.wfdetails;
this.datas = sortByKey(resp.data.data, "dDate"); this.qhsum = resp.data.data.sum_wfi_quantity;
//this.datas = sortByKey(resp.data.data, "dDate");
this.datas.forEach(item => { this.datas.forEach(item => {
if (item.datewaring === "15天内发货") { if (item.datewaring === "15天内发货") {
item.cellClassName = { item.cellClassName = {
@@ -396,7 +407,26 @@ export default {
} }
}); });
}, },
async onSearch(search) { // throttle(method, context) {
// clearTimeout(method);
// method = setTimeout(function() {
// //method.call(context);
// }, 1200);
// },
throttle(method, delay) {
var timer = null;
return function() {
var context = this,
args = arguments;
clearTimeout(timer);
timer = setTimeout(function() {
method.apply(context, args);
}, delay);
};
},
async SonSearch(search) {
console.log(1);
//模拟数据库查询数据 //模拟数据库查询数据
//这个search应该是传到后台,然后台来根据条件查询数据库 //这个search应该是传到后台,然后台来根据条件查询数据库
//alert("查询条件:" + JSON.stringify(search, null, 4)); //alert("查询条件:" + JSON.stringify(search, null, 4));
@@ -404,24 +434,23 @@ export default {
//console.log(search); //console.log(search);
if (JSON.stringify(search.cCusAbbName) == "{}") { if (JSON.stringify(search.c_cus_abb_name) == "{}") {
search.cCusAbbName = ""; search.c_cus_abb_name = "";
} }
if (JSON.stringify(search.cSOCode) == "{}") { if (JSON.stringify(search.c_so_code) == "{}") {
search.cSOCode = ""; search.c_so_code = "";
} }
if (JSON.stringify(search.cInvCode) == "{}") { if (JSON.stringify(search.c_inv_code) == "{}") {
search.cInvCode = ""; search.c_inv_code = "";
} }
if (JSON.stringify(search.cInvName) == "{}") { if (JSON.stringify(search.c_inv_name) == "{}") {
search.cInvName = ""; search.c_inv_name = "";
} }
if (JSON.stringify(search.cInvStd) == "{}") { if (JSON.stringify(search.c_inv_std) == "{}") {
search.c_inv_std = "";
search.cInvStd = "";
} }
if (JSON.stringify(search.wfiQuantity) == "{}") { if (JSON.stringify(search.wfi_quantity) == "{}") {
search.wfiQuantity = ""; search.wfi_quantity = "";
} }
if (JSON.stringify(search.kcyl) == "{}") { if (JSON.stringify(search.kcyl) == "{}") {
search.kcyl = ""; search.kcyl = "";
@@ -429,30 +458,33 @@ export default {
if (JSON.stringify(search.datewaring) == "{}") { if (JSON.stringify(search.datewaring) == "{}") {
search.datewaring = ""; search.datewaring = "";
} }
if (JSON.stringify(search.cMemo) == "{}") { if (JSON.stringify(search.c_memo) == "{}") {
search.cMemo = ""; search.c_memo = "";
} }
let _filert = { let _filert = {
c_cus_abb_name: search.cCusAbbName, c_cus_abb_name: search.c_cus_abb_name,
d_date: search.dDate, d_date: search.d_date,
c_so_code: search.cSOCode, c_so_code: search.c_so_code,
c_inv_code: search.cInvCode, c_inv_code: search.c_inv_code,
c_inv_name: search.cInvName, c_inv_name: search.c_inv_name,
c_inv_std: search.cInvStd, c_inv_std: search.c_inv_std,
wfi_quantity: search.wfiQuantity, wfi_quantity: search.wfi_quantity,
kcyl: search.kcyl, kcyl: search.kcyl,
d_pre_date: search.dPreDate, d_pre_date: search.d_pre_date,
datewaring: search.datewaring, datewaring: search.datewaring,
c_memo: search.cMemo, c_memo: search.c_memo,
jandate: search.jandate, jandate: search.jandate,
kcyl2: search.kcyl2 kcyl2: search.kcyl2
}; };
let resp = await getInventorySale(_filert); let resp = await getInventorySale(_filert);
//let resp = await getInventorySale(_filert);
this.pageNo = 1; this.pageNo = 1;
this.datas = resp.data.data; this.datas = resp.data.data.wfdetails;
this.datas = sortByKey(resp.data.data, "dDate"); this.qhsum = resp.data.data.sum_wfi_quantity;
//this.datas = sortByKey(resp.data.data, "dDate");
this.datas.forEach(item => { this.datas.forEach(item => {
if (item.datewaring === "15天内发货") { if (item.datewaring === "15天内发货") {
item.cellClassName = { item.cellClassName = {
@@ -469,6 +501,14 @@ export default {
} }
}); });
}, },
getRemote: debounce(function() {
this.SonSearch(this.searchText);
}, 500),
onSearch(search) {
this.searchText = search;
this.getRemote();
},
handlePagechange(page) { handlePagechange(page) {
this.pageNo = page; this.pageNo = page;
@@ -541,6 +581,6 @@ body {
} }
.ivu-auto-complete.ivu-select-dropdown { .ivu-auto-complete.ivu-select-dropdown {
max-height: 500px; max-height: 500px;
} }
</style> </style>

View File

@@ -58,7 +58,7 @@ module.exports = {
disableHostCheck: true, disableHostCheck: true,
proxy: { proxy: {
'/api': { '/api': {
// target: 'http://10.0.0.250:8081', // 接口域名 //target: 'http://10.0.0.250:30087', // 接口域名
target: 'http://localhost:61448', // 接口域名 target: 'http://localhost:61448', // 接口域名
changeOrigin: true, // 是否跨域 changeOrigin: true, // 是否跨域
pathRewrite: {} pathRewrite: {}