条件查询,前端分页

This commit is contained in:
zgf committed 2023-12-22 13:22:47 +08:00
1 parent 75c580115c
commit 720cf26a59
10 files changed
+648 -81

No files matched your search

@@ -33,9 +33,36 @@ public class XWMSMFMController : BaseController
} }
[ActionDescription("Sys.Search")] [ActionDescription("Sys.Search")]
public ActionResult Search() public ActionResult Search(string address, string zjcode, string materialcode, string gdbill, int gdline = 0, int ms = 0)
{ {
var data = OracleHelper.GetDataSet("select * from QREQ3.XWMSMFM where rownum <=30").Tables[0]; var sql = @"select * from QREQ3.XWMSMFM where 1=1";
if (!string.IsNullOrEmpty(address))
{
sql += $" and MFGFCY_0 = '{address}'";
}
if (!string.IsNullOrEmpty(zjcode))
{
sql += $" and MFIITMREF_0 like '%{zjcode}%'";
}
if (!string.IsNullOrEmpty(materialcode))
{
sql += $"and ITMREF_0 like '%{materialcode}%'";
}
if (!string.IsNullOrEmpty(gdbill))
{
sql += $" and MFGNUM_0 like '%{gdbill}%'";
}
if (gdline != 0)
{
sql += $" and MFGLIN_0 = '{gdline}'";
}
if (ms != 0)
{
sql += $" and STOCOD_0 = '{ms}'";
}
var data = OracleHelper.GetDataSet(sql).Tables[0];
var list = data.AsEnumerable().Select var list = data.AsEnumerable().Select
(x => new (x => new
{ {
@@ -52,7 +52,7 @@ public class XWMSPOHController : BaseController
{ {
sql += $"and ITMREF_0 like '%{materialcode}%'"; sql += $"and ITMREF_0 like '%{materialcode}%'";
} }
sql += " and rownum <=30";
var data = OracleHelper.GetDataSet(sql).Tables[0]; var data = OracleHelper.GetDataSet(sql).Tables[0];
var list = data.AsEnumerable().Select var list = data.AsEnumerable().Select
(x => new (x => new
@@ -83,6 +83,7 @@ public class XWMSPOHController : BaseController
STA_0 = x.Field<string>("STA_0"), STA_0 = x.Field<string>("STA_0"),
} }
).ToList(); ).ToList();
return JsonMore(list); return JsonMore(list);
} }
@@ -33,9 +33,31 @@ public class XWMSPTHController : BaseController
} }
[ActionDescription("Sys.Search")] [ActionDescription("Sys.Search")]
public ActionResult Search() public ActionResult Search(string address, string billno, string supply, string materialcode, string cgsh)
{ {
var data = OracleHelper.GetDataSet("select * from QREQ3.XWMSPTH where rownum <=30").Tables[0]; var sql = @"select * from QREQ3.XWMSPTH where 1=1";
if (!string.IsNullOrEmpty(address))
{
sql += $" and PRHFCY_0 = '{address}'";
}
if (!string.IsNullOrEmpty(billno))
{
sql += $" and POHNUM_0 like '%{billno}%'";
}
if (!string.IsNullOrEmpty(supply))
{
sql += $" and BPSNUM_0 like '%{supply}%'";
}
if (!string.IsNullOrEmpty(materialcode))
{
sql += $"and ITMREF_0 like '%{materialcode}%'";
}
if (!string.IsNullOrEmpty(cgsh))
{
sql += $"and PTHNUM_0 like '%{cgsh}%'";
}
var data = OracleHelper.GetDataSet(sql).Tables[0];
var list = data.AsEnumerable().Select var list = data.AsEnumerable().Select
(x => new (x => new
{ {
@@ -33,9 +33,27 @@ public class XWMSSHIPController : BaseController
} }
[ActionDescription("Sys.Search")] [ActionDescription("Sys.Search")]
public ActionResult Search() public ActionResult Search(string address, string billno, string sbill, string materialcode)
{ {
var data = OracleHelper.GetDataSet("select * from QREQ3.XWMSSHIP where rownum <=30").Tables[0]; var sql = @"select * from QREQ3.XWMSSHIP where 1=1";
if (!string.IsNullOrEmpty(address))
{
sql += $" and FCY_0 = '{address}'";
}
if (!string.IsNullOrEmpty(billno))
{
sql += $" and POHNUM_0 like '%{billno}%'";
}
if (!string.IsNullOrEmpty(sbill))
{
sql += $" and SDHNUM_0 like '%{sbill}%'";
}
if (!string.IsNullOrEmpty(materialcode))
{
sql += $"and ITMREF_0 like '%{materialcode}%'";
}
var data = OracleHelper.GetDataSet(sql).Tables[0];
var list = data.AsEnumerable().Select var list = data.AsEnumerable().Select
(x => new (x => new
{ {
@@ -33,9 +33,28 @@ public class XWMSSOHController : BaseController
} }
[ActionDescription("Sys.Search")] [ActionDescription("Sys.Search")]
public ActionResult Search() public ActionResult Search(string address, string billno, string cust, string materialcode)
{ {
var data = OracleHelper.GetDataSet("select * from QREQ3.XWMSSOH where rownum <=30").Tables[0]; var sql = @"select * from QREQ3.XWMSSOH where 1=1";
if (!string.IsNullOrEmpty(address))
{
sql += $" and SALFCY_0 = '{address}'";
}
if (!string.IsNullOrEmpty(billno))
{
sql += $" and SOHNUM_0 like '%{billno}%'";
}
if (!string.IsNullOrEmpty(cust))
{
sql += $" and BPCNAM_0 like '%{cust}%'";
}
if (!string.IsNullOrEmpty(materialcode))
{
sql += $"and ITMREF_0 like '%{materialcode}%'";
}
var data = OracleHelper.GetDataSet(sql).Tables[0];
var list = data.AsEnumerable().Select var list = data.AsEnumerable().Select
(x => new (x => new
{ {
+148 -15
View File
@@ -23,11 +23,49 @@
} }
</style> </style>
<el-row id="XWMSMFM"> <el-row id="XWMSMFM">
<el-table :data="billTable" height="750" stripe border <el-form :inline="true" :model="form">
<el-col span="24">
<el-button type="primary" icon="el-icon-plus" @@click="create">创建单据</el-button>
</el-col>
<el-form-item>
<el-select v-model="form.address" placeholder="地点">
<el-option v-for="item in addressList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-input v-model="form.zjcode" placeholder="组件编码"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="form.materialcode" placeholder="产品编码"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="form.gdbill" placeholder="工单单号"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="form.gdline" placeholder="工单行号"></el-input>
</el-form-item>
<el-form-item>
<el-select v-model="form.ms" placeholder="追踪模式">
<el-option v-for="item in msList"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" @@click="search" circle></el-button>
</el-form-item>
</el-form>
<el-table :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)" height="650" stripe border
style="width: 100%" style="width: 100%"
size="small" size="small"
@@cell-mouse-enter="handleCellEnter" @@cell-mouse-enter="handleCellEnter"
@@cell-mouse-leave="handleCellLeave"> @@cell-mouse-leave="handleCellLeave"
@@selection-change="handleSelectionChange">
<el-table-column type="selection" <el-table-column type="selection"
width="55"> width="55">
</el-table-column> </el-table-column>
@@ -53,6 +91,15 @@
<el-table-column label="存货追踪模式" width="100" align="center" prop="STOCOD_0"></el-table-column> <el-table-column label="存货追踪模式" width="100" align="center" prop="STOCOD_0"></el-table-column>
</el-table> </el-table>
<el-pagination align='center'
@@size-change="handleSizeChange"
@@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[1,5,10,20]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.length">
</el-pagination>
</el-row> </el-row>
<script> <script>
@@ -60,25 +107,55 @@
el: "#XWMSMFM", el: "#XWMSMFM",
data() { data() {
return { return {
billTable: [], form: {
address: '',
zjcode: '',
materialcode: '',
gdbill: '',
gdline:'',
ms:''
},
//1:正常扣料,2:倒扣料,3:不管理
msList: [{
value: '1',
label: '正常扣料'
}, {
value: '2',
label: '倒扣料'
}, {
value: '3',
label: '不管理'
}],
addressList: [{
value: 'QCT',
label: 'QCT'
}, {
value: 'SBD',
label: 'SBD'
}],
tableData: [],
currentPage: 1, // 当前页码
total: 20, // 总条数
pageSize: 20, // 每页的数据条数
multipleSelection: [],
// 需要编辑的属性 // 需要编辑的属性
editProp: ['POHFCY_0'] editProp: ['POHFCY_0']
}; };
}, },
mounted: function () { mounted: function () {
// 获取所有单据编码 // 获取所有单据编码
$.ajax({ // $.ajax({
type: "post", // type: "post",
dataType: "json", // dataType: "json",
data: {}, // data: {},
url: "/xwms/XWMSMFM/Search", // url: "/xwms/XWMSMFM/Search",
success: function (json) { // success: function (json) {
app.billTable = json.Data; // app.tableData = json.Data;
}, // },
error: function (json) { // error: function (json) {
alert("加载失败"); // alert("加载失败");
} // }
}); // });
}, },
computed: { computed: {
foodLabel() { foodLabel() {
@@ -103,6 +180,62 @@
cell.querySelector('.item__input').style.display = 'none' cell.querySelector('.item__input').style.display = 'none'
cell.querySelector('.item__txt').style.display = 'block' cell.querySelector('.item__txt').style.display = 'block'
} }
},
//每页条数改变时触发 选择一页显示多少行
handleSizeChange(val) {
this.currentPage = 1;
this.pageSize = val;
},
//当前页改变时触发 跳转其他页
handleCurrentChange(val) {
this.currentPage = val;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
search() {
var _this = this;
$.ajax({
type: "post",
dataType: "json",
data: {
address: _this.form.address,
zjcode: _this.form.zjcode,
materialcode: _this.form.materialcode,
gdbill: _this.form.gdbill,
gdline: _this.form.gdline,
ms: _this.form.ms
},
url: "/xwms/XWMSMFM/Search",
success: function (json) {
app.tableData = json.Data;
},
error: function (json) {
alert("加载失败");
}
});
},
create() {
var _this = this;
$.ajax({
type: "post",
dataType: "json",
data: {
data: _this.multipleSelection
},
url: "/xwms/XWMSMFM/Create",
success: function (json) {
if (json.Code == 200) {
_this.$message({
message: "创建成功!"
});
_this.$refs.multipleTable.clearSelection();
}
},
error: function (json) {
alert("加载失败");
}
});
} }
}, },
}); });
+29 -10
View File
@@ -192,7 +192,8 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table :data="billTable" height="750" stripe border <el-table :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)"
height="650" stripe border
style="width: 100%" style="width: 100%"
size="small" size="small"
@@cell-mouse-enter="handleCellEnter" @@cell-mouse-enter="handleCellEnter"
@@ -252,6 +253,16 @@
<el-table-column label="备注" align="center" prop="YITMDES4_0" show-overflow-tooltip></el-table-column> <el-table-column label="备注" align="center" prop="YITMDES4_0" show-overflow-tooltip></el-table-column>
</el-table> </el-table>
<el-pagination align='center'
@@size-change="handleSizeChange"
@@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[1,5,10,20]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.length">
</el-pagination>
</el-row> </el-row>
<script> <script>
@@ -282,7 +293,10 @@
value: 'R', value: 'R',
label: 'R' label: 'R'
}], }],
billTable: [], tableData: [],
currentPage: 1, // 当前页码
total: 20, // 总条数
pageSize: 20, // 每页的数据条数
// 需要编辑的属性 // 需要编辑的属性
editProp: ['THISQTYUOM', 'THISQTYSTU', 'STA_0'], editProp: ['THISQTYUOM', 'THISQTYSTU', 'STA_0'],
multipleSelection: [] multipleSelection: []
@@ -296,7 +310,7 @@
// data: {}, // data: {},
// url: "/xwms/XWMSPOH/Search", // url: "/xwms/XWMSPOH/Search",
// success: function (json) { // success: function (json) {
// app.billTable = json.Data; // app.tableData = json.Data;
// }, // },
// error: function (json) { // error: function (json) {
// alert("加载失败"); // alert("加载失败");
@@ -327,9 +341,15 @@
cell.querySelector('.item__txt').style.display = 'block' cell.querySelector('.item__txt').style.display = 'block'
} }
}, },
// handleCellClick(row, column, cell, event) { //每页条数改变时触发 选择一页显示多少行
// console.log(row.STA_0); handleSizeChange(val) {
// }, this.currentPage = 1;
this.pageSize = val;
},
//当前页改变时触发 跳转其他页
handleCurrentChange(val) {
this.currentPage = val;
},
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
@@ -338,14 +358,15 @@
$.ajax({ $.ajax({
type: "post", type: "post",
dataType: "json", dataType: "json",
data: { address: _this.form.address, data: {
address: _this.form.address,
billno: _this.form.billno, billno: _this.form.billno,
supply: _this.form.supply, supply: _this.form.supply,
materialcode: _this.form.materialcode materialcode: _this.form.materialcode
}, },
url: "/xwms/XWMSPOH/Search", url: "/xwms/XWMSPOH/Search",
success: function (json) { success: function (json) {
app.billTable = json.Data; app.tableData = json.Data;
}, },
error: function (json) { error: function (json) {
alert("加载失败"); alert("加载失败");
@@ -353,8 +374,6 @@
}); });
}, },
create() { create() {
var _this = this;
console.log(_this.multipleSelection);
var _this = this; var _this = this;
$.ajax({ $.ajax({
type: "post", type: "post",
+129 -16
View File
@@ -23,16 +23,47 @@
} }
</style> </style>
<el-row id="XWMSPTH"> <el-row id="XWMSPTH">
<el-table :data="billTable" height="750" stripe border <el-form :inline="true" :model="form">
<el-col span="24">
<el-button type="primary" icon="el-icon-plus" @@click="create">采购退货</el-button>
</el-col>
<el-form-item>
<el-select v-model="form.address" placeholder="地点">
<el-option v-for="item in addressList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-input v-model="form.materialcode" placeholder="物料编码"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="form.cgsh" placeholder="采购收货"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="form.billno" placeholder="采购订单"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="form.supply" placeholder="供应商编码"></el-input>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" @@click="search" circle></el-button>
</el-form-item>
</el-form>
<el-table :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)" height="650" stripe border
style="width: 100%" style="width: 100%"
size="small" size="small"
@@cell-mouse-enter="handleCellEnter" @@cell-mouse-enter="handleCellEnter"
@@cell-mouse-leave="handleCellLeave"> @@cell-mouse-leave="handleCellLeave"
@@selection-change="handleSelectionChange">
<el-table-column type="selection" <el-table-column type="selection"
width="55"> width="55">
</el-table-column> </el-table-column>
<el-table-column label="地点" align="center" prop="PRHFCY_0"></el-table-column> <el-table-column label="地点" align="center" prop="PRHFCY_0"></el-table-column>
<el-table-column label="收货日期" width="100" align="center" prop="ORDDAT_0"></el-table-column> <el-table-column label="收货日期" width="100" align="center" prop="RCPDAT_0"></el-table-column>
@* <el-table-column label="供应商" align="center" prop="BPSNUM_0"></el-table-column> *@ @* <el-table-column label="供应商" align="center" prop="BPSNUM_0"></el-table-column> *@
<el-table-column label="供应商名称" width="150" align="center" prop="BPSNAM_0" show-overflow-tooltip></el-table-column> <el-table-column label="供应商名称" width="150" align="center" prop="BPSNAM_0" show-overflow-tooltip></el-table-column>
<el-table-column label="采购收货号" width="150" align="center" prop="PTHNUM_0"></el-table-column> <el-table-column label="采购收货号" width="150" align="center" prop="PTHNUM_0"></el-table-column>
@@ -58,6 +89,15 @@
<el-table-column label="本次退货量(库存单位)" width="100" align="center" prop="THISQTYSTU"></el-table-column> <el-table-column label="本次退货量(库存单位)" width="100" align="center" prop="THISQTYSTU"></el-table-column>
<el-table-column label="退货量(采购单位)" width="100" align="center" prop="THISQTYUOM"></el-table-column> <el-table-column label="退货量(采购单位)" width="100" align="center" prop="THISQTYUOM"></el-table-column>
</el-table> </el-table>
<el-pagination align='center'
@@size-change="handleSizeChange"
@@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[1,5,10,20]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.length">
</el-pagination>
</el-row> </el-row>
<script> <script>
@@ -65,25 +105,43 @@
el: "#XWMSPTH", el: "#XWMSPTH",
data() { data() {
return { return {
billTable: [], form: {
address: '',
billno: '',
supply: '',
materialcode: '',
cgsh: ''
},
addressList: [{
value: 'QCT',
label: 'QCT'
}, {
value: 'SBD',
label: 'SBD'
}],
tableData: [],
currentPage: 1, // 当前页码
total: 20, // 总条数
pageSize: 20, // 每页的数据条数
multipleSelection: [],
// 需要编辑的属性 // 需要编辑的属性
editProp: ['POHFCY_0'] editProp: ['POHFCY_0']
}; };
}, },
mounted: function () { mounted: function () {
// 获取所有单据编码 // 获取所有单据编码
$.ajax({ // $.ajax({
type: "post", // type: "post",
dataType: "json", // dataType: "json",
data: {}, // data: {},
url: "/xwms/XWMSPTH/Search", // url: "/xwms/XWMSPTH/Search",
success: function (json) { // success: function (json) {
app.billTable = json.Data; // app.tableData = json.Data;
}, // },
error: function (json) { // error: function (json) {
alert("加载失败"); // alert("加载失败");
} // }
}); // });
}, },
computed: { computed: {
foodLabel() { foodLabel() {
@@ -108,6 +166,61 @@
cell.querySelector('.item__input').style.display = 'none' cell.querySelector('.item__input').style.display = 'none'
cell.querySelector('.item__txt').style.display = 'block' cell.querySelector('.item__txt').style.display = 'block'
} }
},
//每页条数改变时触发 选择一页显示多少行
handleSizeChange(val) {
this.currentPage = 1;
this.pageSize = val;
},
//当前页改变时触发 跳转其他页
handleCurrentChange(val) {
this.currentPage = val;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
search() {
var _this = this;
$.ajax({
type: "post",
dataType: "json",
data: {
address: _this.form.address,
billno: _this.form.billno,
supply: _this.form.supply,
materialcode: _this.form.materialcode,
cgsh: _this.form.cgsh,
},
url: "/xwms/XWMSPTH/Search",
success: function (json) {
app.tableData = json.Data;
},
error: function (json) {
alert("加载失败");
}
});
},
create() {
var _this = this;
$.ajax({
type: "post",
dataType: "json",
data: {
data: _this.multipleSelection
},
url: "/xwms/XWMSPTH/Create",
success: function (json) {
if (json.Code == 200) {
_this.$message({
message: "创建成功!"
});
_this.$refs.multipleTable.clearSelection();
}
},
error: function (json) {
alert("加载失败");
}
});
} }
}, },
}); });
+123 -16
View File
@@ -23,11 +23,38 @@
} }
</style> </style>
<el-row id="XWMSSHIP"> <el-row id="XWMSSHIP">
<el-table :data="billTable" height="750" stripe border <el-form :inline="true" :model="form">
<el-col span="24">
<el-button type="primary" icon="el-icon-plus" @@click="create">创建单据</el-button>
</el-col>
<el-form-item>
<el-select v-model="form.address" placeholder="地点">
<el-option v-for="item in addressList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-input v-model="form.sbill" placeholder="收货单号"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="form.billno" placeholder="采购订单"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="form.materialcode" placeholder="物料编码"></el-input>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" @@click="search" circle></el-button>
</el-form-item>
</el-form>
<el-table :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)" height="650" stripe border
style="width: 100%" style="width: 100%"
size="small" size="small"
@@cell-mouse-enter="handleCellEnter" @@cell-mouse-enter="handleCellEnter"
@@cell-mouse-leave="handleCellLeave"> @@cell-mouse-leave="handleCellLeave"
@@selection-change="handleSelectionChange">
<el-table-column type="selection" <el-table-column type="selection"
width="55"> width="55">
</el-table-column> </el-table-column>
@@ -37,7 +64,7 @@
<el-table-column label="内部供应商名称" width="150" align="center" prop="BPRNAM_0" show-overflow-tooltip></el-table-column> <el-table-column label="内部供应商名称" width="150" align="center" prop="BPRNAM_0" show-overflow-tooltip></el-table-column>
<el-table-column label="发货单号" width="150" align="center" prop="SDHNUM_0"></el-table-column> <el-table-column label="发货单号" width="150" align="center" prop="SDHNUM_0"></el-table-column>
<el-table-column label="发货行号" width="100" align="center" prop="SDDLIN_0"></el-table-column> <el-table-column label="发货行号" width="100" align="center" prop="SDDLIN_0"></el-table-column>
<el-table-column label="产品编码" width="100" align="center" prop="ITMREF_0"></el-table-column> <el-table-column label="产品编码" width="180" align="center" prop="ITMREF_0"></el-table-column>
<el-table-column label="名称" width="150" align="center" prop="ITMDES1_0" show-overflow-tooltip></el-table-column> <el-table-column label="名称" width="150" align="center" prop="ITMDES1_0" show-overflow-tooltip></el-table-column>
<el-table-column label="代号" width="150" align="center" prop="ITMDES2_0" show-overflow-tooltip></el-table-column> <el-table-column label="代号" width="150" align="center" prop="ITMDES2_0" show-overflow-tooltip></el-table-column>
<el-table-column label="备注" width="100" align="center" prop="YITMDES4_0" show-overflow-tooltip></el-table-column> <el-table-column label="备注" width="100" align="center" prop="YITMDES4_0" show-overflow-tooltip></el-table-column>
@@ -51,6 +78,15 @@
<el-table-column label="订单行号" width="100" align="center" prop="POPLIN_0"></el-table-column> <el-table-column label="订单行号" width="100" align="center" prop="POPLIN_0"></el-table-column>
</el-table> </el-table>
<el-pagination align='center'
@@size-change="handleSizeChange"
@@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[1,5,10,20]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.length">
</el-pagination>
</el-row> </el-row>
<script> <script>
@@ -58,25 +94,42 @@
el: "#XWMSSHIP", el: "#XWMSSHIP",
data() { data() {
return { return {
billTable: [], form: {
address: '',
billno: '',
sbill: '',
materialcode: ''
},
addressList: [{
value: 'QCT',
label: 'QCT'
}, {
value: 'SBD',
label: 'SBD'
}],
tableData: [],
currentPage: 1, // 当前页码
total: 20, // 总条数
pageSize: 20, // 每页的数据条数
multipleSelection: [],
// 需要编辑的属性 // 需要编辑的属性
editProp: ['POHFCY_0'] editProp: ['POHFCY_0']
}; };
}, },
mounted: function () { mounted: function () {
// 获取所有单据编码 // 获取所有单据编码
$.ajax({ // $.ajax({
type: "post", // type: "post",
dataType: "json", // dataType: "json",
data: {}, // data: {},
url: "/xwms/XWMSSHIP/Search", // url: "/xwms/XWMSSHIP/Search",
success: function (json) { // success: function (json) {
app.billTable = json.Data; // app.tableData = json.Data;
}, // },
error: function (json) { // error: function (json) {
alert("加载失败"); // alert("加载失败");
} // }
}); // });
}, },
computed: { computed: {
foodLabel() { foodLabel() {
@@ -101,6 +154,60 @@
cell.querySelector('.item__input').style.display = 'none' cell.querySelector('.item__input').style.display = 'none'
cell.querySelector('.item__txt').style.display = 'block' cell.querySelector('.item__txt').style.display = 'block'
} }
},
//每页条数改变时触发 选择一页显示多少行
handleSizeChange(val) {
this.currentPage = 1;
this.pageSize = val;
},
//当前页改变时触发 跳转其他页
handleCurrentChange(val) {
this.currentPage = val;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
search() {
var _this = this;
$.ajax({
type: "post",
dataType: "json",
data: {
address: _this.form.address,
billno: _this.form.billno,
sbill: _this.form.sbill,
materialcode: _this.form.materialcode
},
url: "/xwms/XWMSSHIP/Search",
success: function (json) {
app.tableData = json.Data;
},
error: function (json) {
alert("加载失败");
}
});
},
create() {
var _this = this;
$.ajax({
type: "post",
dataType: "json",
data: {
data: _this.multipleSelection
},
url: "/xwms/XWMSSHIP/Create",
success: function (json) {
if (json.Code == 200) {
_this.$message({
message: "创建成功!"
});
_this.$refs.multipleTable.clearSelection();
}
},
error: function (json) {
alert("加载失败");
}
});
} }
}, },
}); });
+123 -15
View File
@@ -23,11 +23,39 @@
} }
</style> </style>
<el-row id="XWMSSOH"> <el-row id="XWMSSOH">
<el-table :data="billTable" height="750" stripe border <el-form :inline="true" :model="form">
<el-col span="24">
<el-button type="primary" icon="el-icon-plus" @@click="create">创建单据</el-button>
</el-col>
<el-form-item>
<el-select v-model="form.address" placeholder="地点">
<el-option v-for="item in addressList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-input v-model="form.materialcode" placeholder="物料编码"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="form.billno" placeholder="销售订单"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="form.cust" placeholder="客户名称"></el-input>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" @@click="search" circle></el-button>
</el-form-item>
</el-form>
<el-table :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)" height="650" stripe border
style="width: 100%" style="width: 100%"
size="small" size="small"
@@cell-mouse-enter="handleCellEnter" @@cell-mouse-enter="handleCellEnter"
@@cell-mouse-leave="handleCellLeave"> @@cell-mouse-leave="handleCellLeave"
@@selection-change="handleSelectionChange">
<el-table-column type="selection" <el-table-column type="selection"
width="55"> width="55">
</el-table-column> </el-table-column>
@@ -49,6 +77,15 @@
<el-table-column label="发货地址" width="100" align="center" prop="BPAADD_0"></el-table-column> <el-table-column label="发货地址" width="100" align="center" prop="BPAADD_0"></el-table-column>
</el-table> </el-table>
<el-pagination align='center'
@@size-change="handleSizeChange"
@@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[1,5,10,20]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.length">
</el-pagination>
</el-row> </el-row>
<script> <script>
@@ -56,25 +93,42 @@
el: "#XWMSSOH", el: "#XWMSSOH",
data() { data() {
return { return {
billTable: [], form: {
address: '',
billno: '',
cust: '',
materialcode: ''
},
addressList: [{
value: 'QCT',
label: 'QCT'
}, {
value: 'SBD',
label: 'SBD'
}],
tableData: [],
currentPage: 1, // 当前页码
total: 20, // 总条数
pageSize: 20, // 每页的数据条数
multipleSelection: [],
// 需要编辑的属性 // 需要编辑的属性
editProp: ['POHFCY_0'] editProp: ['POHFCY_0']
}; };
}, },
mounted: function () { mounted: function () {
// 获取所有单据编码 // 获取所有单据编码
$.ajax({ // $.ajax({
type: "post", // type: "post",
dataType: "json", // dataType: "json",
data: {}, // data: {},
url: "/xwms/XWMSSOH/Search", // url: "/xwms/XWMSSOH/Search",
success: function (json) { // success: function (json) {
app.billTable = json.Data; // app.tableData = json.Data;
}, // },
error: function (json) { // error: function (json) {
alert("加载失败"); // alert("加载失败");
} // }
}); // });
}, },
computed: { computed: {
foodLabel() { foodLabel() {
@@ -99,6 +153,60 @@
cell.querySelector('.item__input').style.display = 'none' cell.querySelector('.item__input').style.display = 'none'
cell.querySelector('.item__txt').style.display = 'block' cell.querySelector('.item__txt').style.display = 'block'
} }
},
//每页条数改变时触发 选择一页显示多少行
handleSizeChange(val) {
this.currentPage = 1;
this.pageSize = val;
},
//当前页改变时触发 跳转其他页
handleCurrentChange(val) {
this.currentPage = val;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
search() {
var _this = this;
$.ajax({
type: "post",
dataType: "json",
data: {
address: _this.form.address,
billno: _this.form.billno,
cust: _this.form.cust,
materialcode: _this.form.materialcode
},
url: "/xwms/XWMSSOH/Search",
success: function (json) {
app.tableData = json.Data;
},
error: function (json) {
alert("加载失败");
}
});
},
create() {
var _this = this;
$.ajax({
type: "post",
dataType: "json",
data: {
data: _this.multipleSelection
},
url: "/xwms/XWMSSOH/Create",
success: function (json) {
if (json.Code == 200) {
_this.$message({
message: "创建成功!"
});
_this.$refs.multipleTable.clearSelection();
}
},
error: function (json) {
alert("加载失败");
}
});
} }
}, },
}); });