增加日期查询条件,显示金额

This commit is contained in:
杰 朱
2021-05-11 13:11:56 +08:00
parent 4b07264ddc
commit d874fea6cb
3 changed files with 70 additions and 14 deletions

View File

@@ -21,6 +21,9 @@ namespace NX.ERP.Model.Request
public DateTime? BeginDate { get; set; } public DateTime? BeginDate { get; set; }
public DateTime? EndDate { get; set; } public DateTime? EndDate { get; set; }
public DateTime? BeginDate2 { get; set; }
public DateTime? EndDate2 { get; set; }

View File

@@ -22,14 +22,19 @@ namespace NX.ERP.U8.Finance
public IEnumerable<object> InventorySNDetail(NX.ERP.Model.Request.SnOrderRequest info1) public IEnumerable<object> InventorySNDetail(NX.ERP.Model.Request.SnOrderRequest info1)
{ {
string sql = $@" string sql = $@"
select a.cInvCode,e.cInvName,b.cCode as Cprk, b.dDate as rkrq,c.cWhName,b.cMPoCode,d.cDepName,a.cInvSN,g.cCode as Clck,g.dDate as ckrq,h.cCusAbbName,f.cInvSN as ckcInvSN from ST_SNDetail_PROIN a select a.cInvCode,e.cInvName,b.cCode as Cprk, b.dDate as rkrq,c.cWhName,
left join rdrecord10 b on a.iVouchID=b.id b.cMPoCode,d.cDepName,a.cInvSN,k.iUnitCost,
left join Warehouse c on b.cWhCode =c.cWhCode g.cCode as Clck,g.dDate as ckrq,h.cCusAbbName,f.cInvSN as ckcInvSN
left join Department d on b.cDepCode =d.cDepCode from ST_SNDetail_PROIN a WITH(NOLOCK)
left join Inventory e on a.cInvCode=e.cInvCode left join rdrecord10 b WITH(NOLOCK) on a.iVouchID=b.id
left join ST_SNDetail_SaleOut f on a.cInvSN= f.cInvSN left join rdrecords10 k WITH(NOLOCK) on a.iVouchsID=k.autoid
left join rdrecord32 g on f.iVouchID=g.id left join Warehouse c WITH(NOLOCK) on b.cWhCode =c.cWhCode
left join Customer h on g.cCusCode=h.cCusCode left join Department d WITH(NOLOCK) on b.cDepCode =d.cDepCode
left join Inventory e WITH(NOLOCK) on a.cInvCode=e.cInvCode
left join ST_SNDetail_SaleOut f WITH(NOLOCK) on a.cInvSN= f.cInvSN
left join rdrecord32 g WITH(NOLOCK) on f.iVouchID=g.id
left join Customer h WITH(NOLOCK) on g.cCusCode=h.cCusCode
"; ";
@@ -60,6 +65,12 @@ namespace NX.ERP.U8.Finance
} }
if (info1.BeginDate2 != null && info1.EndDate2 != null)
{
where.Add(" g.dDate between @beginDate2 and @endDate2 ");
}
var aa = string.Join(" and ", where.ToArray()); var aa = string.Join(" and ", where.ToArray());
@@ -71,7 +82,7 @@ namespace NX.ERP.U8.Finance
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection) using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
{ {
return conn.Query<object>(sql, new { cInvCode = info1.cInvCodes, Cprk = info1.Cprk, info1.Clck, info1.cInvSN }); return conn.Query<object>(sql, new { cInvCode = info1.cInvCodes, Cprk = info1.Cprk, info1.Clck, info1.cInvSN, beginDate=info1.BeginDate, endDate= info1.EndDate, beginDate2 = info1.BeginDate2, endDate2 = info1.EndDate2 });
} }
} }

View File

@@ -3,11 +3,11 @@
<h4>序列号查询</h4> <h4>序列号查询</h4>
<div> <div>
<Row :gutter="16"> <Row :gutter="16">
<Col span="4"> <Col span="3">
<label>产品入库订单编号</label> <label>产品入库订单编号</label>
<Input v-model="filter.cprk" /> <Input v-model="filter.cprk" />
</Col> </Col>
<Col span="4"> <Col span="3">
<label>销售出库订单编号</label> <label>销售出库订单编号</label>
<Input v-model="filter.clck" /> <Input v-model="filter.clck" />
</Col> </Col>
@@ -21,6 +21,18 @@
<label>序列号</label> <label>序列号</label>
<Input autosize type="textarea" v-model="filter.c_inv_sn" /> <Input autosize type="textarea" v-model="filter.c_inv_sn" />
</Col> </Col>
<Col span="3">
<label>入库单据期间</label>
<div>
<DatePicker v-model="filter.dates" type="daterange"></DatePicker>
</div>
</Col>
<Col span="3">
<label>出库单据期间</label>
<div>
<DatePicker v-model="filter.dates2" type="daterange"></DatePicker>
</div>
</Col>
<Col span="4"> <Col span="4">
<Button <Button
@@ -86,6 +98,7 @@ export default {
c_inv_codes: "", c_inv_codes: "",
c_inv_sn: "", c_inv_sn: "",
dates: [], dates: [],
dates2: [],
}, },
columns: [ columns: [
{ {
@@ -102,7 +115,7 @@ export default {
title: "入库单号", title: "入库单号",
align: "center", align: "center",
key: "Cprk", key: "Cprk",
className: "demo-table-info-new", className: "demo-table-info-new",
}, },
{ {
title: "入库日期", title: "入库日期",
@@ -132,6 +145,11 @@ export default {
align: "center", align: "center",
key: "cInvSN", key: "cInvSN",
}, },
{
title: "入库金额",
align: "center",
key: "iUnitCost",
},
{ {
title: "出库库单号", title: "出库库单号",
align: "center", align: "center",
@@ -180,7 +198,31 @@ export default {
this.loadData(); this.loadData();
}, },
async loadData() { async loadData() {
let _beginDate = null;
let _endDate = null;
let _beginDate2 = null;
let _endDate2 = 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];
}
if (
this.filter.dates2.length == 2 &&
this.filter.dates2[0] !== "" &&
this.filter.dates2[0] !== ""
) {
_beginDate2 = this.filter.dates2[0];
_endDate2 = this.filter.dates2[1];
}
let _filert = { let _filert = {
begin_date: _beginDate,
end_date: _endDate,
begin_date2: _beginDate2,
end_date2: _endDate2,
cprk: cprk:
this.filter.cprk !== "" ? this.filter.cprk.split(/[,\s\n,]/) : null, this.filter.cprk !== "" ? this.filter.cprk.split(/[,\s\n,]/) : null,
clck: clck: