修订
This commit is contained in:
@@ -905,65 +905,80 @@ select *from tempdb..tablepzck20210526
|
|||||||
// where.Add(" a.iQuantity - isnull(d.cqty,0) >0 and b.cVerifier is not null ");
|
// where.Add(" a.iQuantity - isnull(d.cqty,0) >0 and b.cVerifier is not null ");
|
||||||
|
|
||||||
where.Add(" mm.wfiQuantity >0 and mm.cVerifier is not null ");
|
where.Add(" mm.wfiQuantity >0 and mm.cVerifier is not null ");
|
||||||
if(info1 !=null)
|
if(info1 ==null)
|
||||||
{
|
{
|
||||||
|
info1 = new NX.ERP.Model.Request.SaleinvRequest();
|
||||||
|
info1.cCusAbbName = null;
|
||||||
|
info1.dDate = null;
|
||||||
|
info1.cSOCode = null;
|
||||||
|
info1.cInvCode = null;
|
||||||
|
info1.cInvName = null;
|
||||||
|
info1.cInvStd = null;
|
||||||
|
info1.cMemo = null;
|
||||||
|
info1.dPreDate = null;
|
||||||
|
info1.wfiQuantity = null;
|
||||||
|
info1.kcyl = null;
|
||||||
|
info1.jandate = null;
|
||||||
|
info1.kcyl2 = null;
|
||||||
|
info1.datewaring = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info1.cCusAbbName))
|
if (!string.IsNullOrEmpty(info1.cCusAbbName))
|
||||||
{
|
{
|
||||||
where.Add(" mm.cCusAbbName like @cCusAbbName ");
|
where.Add(" mm.cCusAbbName like @cCusAbbName ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info1.dDate))
|
if (!string.IsNullOrEmpty(info1.dDate))
|
||||||
{
|
{
|
||||||
where.Add(" mm.dDate = @dDate ");
|
where.Add(" mm.dDate = @dDate ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info1.cSOCode))
|
if (!string.IsNullOrEmpty(info1.cSOCode))
|
||||||
{
|
{
|
||||||
where.Add(" mm.cSOCode = @cSOCode ");
|
where.Add(" mm.cSOCode like @cSOCode ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info1.cInvCode))
|
if (!string.IsNullOrEmpty(info1.cInvCode))
|
||||||
{
|
{
|
||||||
where.Add(" mm.cInvCode like @cInvCode ");
|
where.Add(" mm.cInvCode like @cInvCode ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info1.cInvName))
|
if (!string.IsNullOrEmpty(info1.cInvName))
|
||||||
{
|
{
|
||||||
where.Add(" mm.cInvName like @cInvName ");
|
where.Add(" mm.cInvName like @cInvName ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info1.cInvStd))
|
if (!string.IsNullOrEmpty(info1.cInvStd))
|
||||||
{
|
{
|
||||||
where.Add(" mm.cInvStd like @cInvStd ");
|
where.Add(" mm.cInvStd like @cInvStd ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info1.cMemo))
|
if (!string.IsNullOrEmpty(info1.cMemo))
|
||||||
{
|
{
|
||||||
where.Add(" mm.cMemo like @cMemo ");
|
where.Add(" mm.cMemo like @cMemo ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info1.dPreDate))
|
if (!string.IsNullOrEmpty(info1.dPreDate))
|
||||||
{
|
{
|
||||||
where.Add(" mm.dPreDate = @dPreDate ");
|
where.Add(" mm.dPreDate = @dPreDate ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info1.wfiQuantity))
|
if (!string.IsNullOrEmpty(info1.wfiQuantity))
|
||||||
{
|
{
|
||||||
where.Add(" mm.wfiQuantity = @wfiQuantity ");
|
where.Add(" mm.wfiQuantity = @wfiQuantity ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info1.kcyl))
|
if (!string.IsNullOrEmpty(info1.kcyl))
|
||||||
{
|
{
|
||||||
where.Add(" mm.kcyl = @kcyl ");
|
where.Add(" mm.kcyl = @kcyl ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info1.jandate))
|
if (!string.IsNullOrEmpty(info1.jandate))
|
||||||
{
|
{
|
||||||
where.Add(" mm.jandate = @jandate ");
|
where.Add(" mm.jandate = @jandate ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info1.kcyl2))
|
if (!string.IsNullOrEmpty(info1.kcyl2))
|
||||||
{
|
{
|
||||||
if (info1.kcyl2 == "1")
|
if (info1.kcyl2 == "1")
|
||||||
{
|
{
|
||||||
@@ -976,7 +991,7 @@ select *from tempdb..tablepzck20210526
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info1.datewaring))
|
if (!string.IsNullOrEmpty(info1.datewaring))
|
||||||
{
|
{
|
||||||
if (info1.datewaring == "1")
|
if (info1.datewaring == "1")
|
||||||
{
|
{
|
||||||
@@ -1011,7 +1026,7 @@ select *from tempdb..tablepzck20210526
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (info1.flag != null && info1.flag.ToList().Count>0)
|
if (info1.flag != null && info1.flag.ToList().Count>0)
|
||||||
{
|
{
|
||||||
List<string> str = new List<string>();
|
List<string> str = new List<string>();
|
||||||
|
|
||||||
@@ -1039,9 +1054,9 @@ select *from tempdb..tablepzck20210526
|
|||||||
strs = " ( " + strs + " ) ";
|
strs = " ( " + strs + " ) ";
|
||||||
|
|
||||||
where.Add(strs);
|
where.Add(strs);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var aa = string.Join(" and ", where.ToArray());
|
var aa = string.Join(" and ", where.ToArray());
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(aa))
|
if (!string.IsNullOrEmpty(aa))
|
||||||
@@ -1051,7 +1066,7 @@ 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, }); }
|
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, }); }
|
||||||
catch { return null; }
|
catch { return null; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,15 @@
|
|||||||
<div>
|
<div>
|
||||||
<Table border :data="filters" :columns="tableColumnsFilters"></Table>
|
<Table border :data="filters" :columns="tableColumnsFilters"></Table>
|
||||||
|
|
||||||
<Table :show-header="false" border :data="data" :columns="columns"></Table>
|
<Table
|
||||||
|
:show-header="false"
|
||||||
|
border
|
||||||
|
:data="data"
|
||||||
|
:columns="columns"
|
||||||
|
show-summary
|
||||||
|
show-context-menu
|
||||||
|
:summary-method="handleSummary"
|
||||||
|
></Table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -13,6 +21,18 @@ export default {
|
|||||||
columns: Array, //列描述数据对象
|
columns: Array, //列描述数据对象
|
||||||
data: Array //表格数据
|
data: Array //表格数据
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
custnanme() {
|
||||||
|
this.data.forEach(item => {
|
||||||
|
//console.log(1)
|
||||||
|
this.data3.push(item.cCusAbbName);
|
||||||
|
});
|
||||||
|
this.data3 = this.noRepeat(this.data3);
|
||||||
|
this.data3 = this.data3.slice(0, 10);
|
||||||
|
//console.log(this.data3);
|
||||||
|
return this.data3;
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
filters: [
|
filters: [
|
||||||
@@ -20,7 +40,7 @@ export default {
|
|||||||
title: ""
|
title: ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
data3:[],
|
data3: [],
|
||||||
tableColumnsFilters: [],
|
tableColumnsFilters: [],
|
||||||
search: {} //过滤条件保存的对象,就是保存Input框和Select中值
|
search: {} //过滤条件保存的对象,就是保存Input框和Select中值
|
||||||
};
|
};
|
||||||
@@ -68,10 +88,10 @@ export default {
|
|||||||
this.columns[index].filter.type,
|
this.columns[index].filter.type,
|
||||||
{
|
{
|
||||||
props: {
|
props: {
|
||||||
value: '', //Select选项列表一般 0 为全部
|
value: "", //Select选项列表一般 0 为全部
|
||||||
transfer: true,
|
transfer: true,
|
||||||
data :this.data3,
|
data: this.custnanme,
|
||||||
filterMethod:this.filterMethod,
|
filterMethod: this.filterMethod
|
||||||
},
|
},
|
||||||
on: {
|
on: {
|
||||||
"on-change": val => {
|
"on-change": val => {
|
||||||
@@ -156,11 +176,8 @@ export default {
|
|||||||
load() {
|
load() {
|
||||||
//会执行一个load的事件
|
//会执行一个load的事件
|
||||||
this.$emit("on-search", this.search);
|
this.$emit("on-search", this.search);
|
||||||
this.data.forEach(item => {
|
|
||||||
//console.log(1)
|
|
||||||
this.data3.push(item)
|
|
||||||
});
|
|
||||||
|
|
||||||
|
//console.log(data3)
|
||||||
},
|
},
|
||||||
//验证输入框的值
|
//验证输入框的值
|
||||||
validInputValue(index, inputValue) {
|
validInputValue(index, inputValue) {
|
||||||
@@ -171,10 +188,62 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$set(this.search, this.columns[index].key, inputValue);
|
this.$set(this.search, this.columns[index].key, inputValue);
|
||||||
this.load();
|
this.load();
|
||||||
|
},
|
||||||
|
noRepeat(arr) {
|
||||||
|
var hash = [];
|
||||||
|
for (var i = 0; i < arr.length; i++) {
|
||||||
|
if (arr.indexOf(arr[i]) == i) {
|
||||||
|
hash.push(arr[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return hash;
|
||||||
|
},
|
||||||
|
handleSummary({ columns, data }) {
|
||||||
|
const sums = {};
|
||||||
|
columns.forEach((column, index) => {
|
||||||
|
const key = column.key;
|
||||||
|
if (index === 0) {
|
||||||
|
sums[key] = {
|
||||||
|
key,
|
||||||
|
value: "合计"
|
||||||
|
};
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (index != 7) {
|
||||||
|
sums[key] = {
|
||||||
|
key,
|
||||||
|
value: ""
|
||||||
|
};
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const values = data.map(item => Number(item[key]));
|
||||||
|
if (!values.every(value => isNaN(value))) {
|
||||||
|
const v = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr);
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return prev + curr;
|
||||||
|
} else {
|
||||||
|
return prev;
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
sums[key] = {
|
||||||
|
key,
|
||||||
|
value: v
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
sums[key] = {
|
||||||
|
key,
|
||||||
|
value: ""
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
return sums;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style >
|
||||||
</style>
|
</style>
|
||||||
@@ -109,11 +109,11 @@ export default {
|
|||||||
components: { FilterTable },
|
components: { FilterTable },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
PageSizeOpts: [10, 15, 20, 30],
|
PageSizeOpts: [9999],
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
strfilter: "",
|
strfilter: "",
|
||||||
multiple: false,
|
multiple: false,
|
||||||
pageSize: 15,
|
pageSize: 9999,
|
||||||
datas: [],
|
datas: [],
|
||||||
filter: {
|
filter: {
|
||||||
inv_codes: "",
|
inv_codes: "",
|
||||||
@@ -148,7 +148,7 @@ export default {
|
|||||||
align: "center",
|
align: "center",
|
||||||
key: "cCusAbbName",
|
key: "cCusAbbName",
|
||||||
filter: {
|
filter: {
|
||||||
type: "Input"
|
type: "AutoComplete"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -383,10 +383,48 @@ export default {
|
|||||||
//alert("查询条件:" + JSON.stringify(search, null, 4));
|
//alert("查询条件:" + JSON.stringify(search, null, 4));
|
||||||
//console.log(JSON.stringify(search, null, 4));
|
//console.log(JSON.stringify(search, null, 4));
|
||||||
|
|
||||||
console.log(search);
|
//console.log(search);
|
||||||
|
|
||||||
|
if(JSON.stringify(search.cCusAbbName)=="{}")
|
||||||
|
{
|
||||||
|
search.cCusAbbName=""
|
||||||
|
}
|
||||||
|
if(JSON.stringify(search.cSOCode)=="{}")
|
||||||
|
{
|
||||||
|
search.cSOCode=""
|
||||||
|
}
|
||||||
|
if(JSON.stringify(search.cInvCode)=="{}")
|
||||||
|
{
|
||||||
|
search.cInvCode=""
|
||||||
|
}
|
||||||
|
if(JSON.stringify(search.cInvName)=="{}")
|
||||||
|
{
|
||||||
|
search.cInvName=""
|
||||||
|
}
|
||||||
|
if(JSON.stringify(search.cInvStd)=="{}")
|
||||||
|
{
|
||||||
|
console.log(123)
|
||||||
|
search.cInvStd=""
|
||||||
|
}
|
||||||
|
if(JSON.stringify(search.wfiQuantity)=="{}")
|
||||||
|
{
|
||||||
|
search.wfiQuantity=""
|
||||||
|
}
|
||||||
|
if(JSON.stringify(search.kcyl)=="{}")
|
||||||
|
{
|
||||||
|
search.kcyl=""
|
||||||
|
}
|
||||||
|
if(JSON.stringify(search.datewaring)=="{}")
|
||||||
|
{
|
||||||
|
search.datewaring=""
|
||||||
|
}
|
||||||
|
if(JSON.stringify(search.cMemo)=="{}")
|
||||||
|
{
|
||||||
|
search.cMemo=""
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
let _filert = {
|
let _filert = {
|
||||||
abc:"123",
|
|
||||||
c_cus_abb_name: search.cCusAbbName,
|
c_cus_abb_name: search.cCusAbbName,
|
||||||
d_date: search.dDate,
|
d_date: search.dDate,
|
||||||
c_so_code: search.cSOCode,
|
c_so_code: search.cSOCode,
|
||||||
@@ -489,4 +527,8 @@ a {
|
|||||||
body {
|
body {
|
||||||
padding: 10px 1;
|
padding: 10px 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ivu-select-dropdown-transfer{
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user