查询条件

This commit is contained in:
zgf committed 2023-12-22 11:41:36 +08:00
1 parent 7ff2c6fe3b
commit 75c580115c
3 files changed
+383 -86

No files matched your search

@@ -33,9 +33,27 @@ public class XWMSPOHController : BaseController
}
[ActionDescription("Sys.Search")]
public ActionResult Search()
public ActionResult Search(string address, string billno, string supply, string materialcode)
{
var data = OracleHelper.GetDataSet("select * from QREQ3.XWMSPOH where rownum <=30").Tables[0];
var sql = @"select * from QREQ3.XWMSPOH where 1=1";
if (!string.IsNullOrEmpty(address))
{
sql += $" and POHFCY_0 = '{address}'";
}
if (!string.IsNullOrEmpty(billno))
{
sql += $" and POHNUM_0 like '%{billno}%'";
}
if (!string.IsNullOrEmpty(supply))
{
sql += $" and BPRNAM_0 like '%{supply}%'";
}
if (!string.IsNullOrEmpty(materialcode))
{
sql += $"and ITMREF_0 like '%{materialcode}%'";
}
sql += " and rownum <=30";
var data = OracleHelper.GetDataSet(sql).Tables[0];
var list = data.AsEnumerable().Select
(x => new
{
@@ -69,4 +87,10 @@ public class XWMSPOHController : BaseController
}
#endregion Search
[HttpPost]
[Public]
public ActionResult Create(List<XWMSPOH> data)
{
return JsonMore(null);
}
}
+346 -84
View File
@@ -1,93 +1,90 @@
<style lang='scss'>
.item{
.item__input{
display: none;
width: 80px;
/* 调整elementUI中样式 如果不需要调整请忽略 */
.el-input__inner{
height: 35px!important;
}
/* 调整elementUI中样式 如果不需要调整请忽略 */
.el-input__suffix{
i{
font-size: 12px !important;
line-height: 26px !important;
}
}
}
.item__txt{
box-sizing: border-box;
line-height: 24px;
padding: 0 9px;
}
}
</style>
<el-row id="XWMSPOH">
<el-table :data="billTable" height="750" stripe border
style="width: 100%"
size="small"
@@cell-mouse-enter="handleCellEnter"
@@cell-mouse-leave="handleCellLeave">
<el-table-column type="selection"
width="55">
</el-table-column>
<el-table-column label="地点" align="center" prop="POHFCY_0">
<div class="item" slot-scope="scope">
<el-input class="item__input" v-model="scope.row.POHFCY_0" placeholder="请输入内容"></el-input>
<div class="item__txt">{{scope.row.POHFCY_0}}</div>
</div>
</el-table-column>
<el-table-column label="订单日期" width="100" align="center" prop="ORDDAT_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="BPRNAM_0" show-overflow-tooltip></el-table-column>
<el-table-column label="订单号" width="180" align="center" prop="POHNUM_0"></el-table-column>
<el-table-column label="行号" width="100" align="center" prop="POPLIN_0"></el-table-column>
<el-table-column label="项目号" width="150" align="center" prop="PJT_0"></el-table-column>
<el-table-column label="项目名称" width="150" align="center" prop="PJTNAM_0"></el-table-column>
<el-table-column label="产品" width="150" 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="ITMDES2_0" show-overflow-tooltip></el-table-column>
<el-table-column label="数量(采购)" width="100" align="center" prop="QTYUOM_0"></el-table-column>
<el-table-column label="采购单位" width="100" align="center" prop="UOM_0"></el-table-column>
<el-table-column label="采购说明" width="150" align="center" prop="POHITMDES1_0" show-overflow-tooltip></el-table-column>
<el-table-column label="数量" width="100" align="center" prop="QTYSTU_0"></el-table-column>
<el-table-column label="库存单位" width="100" align="center" prop="STU_0"></el-table-column>
<el-table-column label="默认质量状态" width="100" align="center" prop="STA_0"></el-table-column>
<el-table-column label="未收采购数量" width="100" align="center" prop="NRCPQTYPUU_0"></el-table-column>
<el-table-column label="未收库存数量" width="100" align="center" prop="NRCPQTYSTU_0"></el-table-column>
<el-table-column label="本次收量(采购单位)" width="200" align="center" prop="THISQTYUOM"></el-table-column>
<el-table-column label="本次收量(库存单位)" width="200" align="center" prop="THISQTYSTU"></el-table-column>
<el-table-column label="计量单位/存货单位系数" width="100" align="center" prop="UOMSTUCOE_0"></el-table-column>
<el-table-column label="材料" align="center" prop="ITMDES3_0" show-overflow-tooltip></el-table-column>
<el-table-column label="备注" align="center" prop="YITMDES4_0"></el-table-column>
@* <div id="test">
<el-table
:data="tableData"
size="mini"
style="width: 600px"
@@cell-mouse-enter="handleCellEnter"
@@cell-mouse-leave="handleCellLeave"
>
<el-table-column
prop="date"
label="日期"
width="180">
<div class="item" slot-scope="scope">
<el-input class="item__input" v-model="scope.row.date" placeholder="请输入内容"></el-input>
<div class="item__txt">{{scope.row.date}}</div>
</div>
</el-table-column>
<el-table-column
prop="name"
label="姓名"
width="180">
<div class="item" slot-scope="scope">
<el-input class="item__input" v-model="scope.row.name" placeholder="请输入内容"></el-input>
<div class="item__txt">{{scope.row.name}}</div>
</div>
</el-table-column>
<el-table-column
prop="food"
label="食物">
<div class="item" slot-scope="scope">
<el-select class="item__input" v-model="scope.row.food" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<div class="item__txt">{{foodLabel(scope.row.food)}}</div>
</div>
</el-table-column>
</el-table>
</el-row>
</div>
<script>
var app = new Vue({
el: "#XWMSPOH",
el: '#test',
data() {
return {
billTable: [],
// 下拉选项
options: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}],
// 表格数据
tableData: [{
date: '2016-05-02',
name: '王小虎',
food: '选项5'
}, {
date: '2016-05-04',
name: '王小虎',
food: '选项5'
}, {
date: '2016-05-01',
name: '王小虎',
food: '选项5'
}, {
date: '2016-05-03',
name: '王小虎',
food: '选项5'
}],
// 需要编辑的属性
editProp: ['POHFCY_0']
};
},
mounted: function () {
// 获取所有单据编码
$.ajax({
type: "post",
dataType: "json",
data: {},
url: "/xwms/XWMSPOH/Search",
success: function (json) {
app.billTable = json.Data;
},
error: function (json) {
alert("加载失败");
}
});
editProp: ['date', 'name', 'food']
}
},
computed: {
foodLabel() {
@@ -113,7 +110,272 @@
cell.querySelector('.item__txt').style.display = 'block'
}
}
},
}
});
</script>
<style lang='scss'>
.item{
.item__input{
display: none;
width: 100px;
/* 调整elementUI中样式 如果不需要调整请忽略 */
.el-input__inner{
height: 24px!important;
}
/* 调整elementUI中样式 如果不需要调整请忽略 */
.el-input__suffix{
i{
font-size: 12px !important;
line-height: 26px !important;
}
}
}
.item__txt{
box-sizing: border-box;
line-height: 24px;
padding: 0 9px;
}
}
</style>
*@
<style lang='scss'>
.item{
.item__input{
display: none;
width: 80px;
/* 调整elementUI中样式 如果不需要调整请忽略 */
.el-input__inner{
height: 35px!important;
}
/* 调整elementUI中样式 如果不需要调整请忽略 */
.el-input__suffix{
i{
font-size: 12px !important;
line-height: 26px !important;
}
}
}
.item__txt{
box-sizing: border-box;
line-height: 24px;
padding: 0 9px;
}
}
</style>
<el-row id="XWMSPOH">
<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.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-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="billTable" height="750" stripe border
style="width: 100%"
size="small"
@@cell-mouse-enter="handleCellEnter"
@@cell-mouse-leave="handleCellLeave"
@@selection-change="handleSelectionChange">
<el-table-column type="index"
width="50">
</el-table-column>
<el-table-column type="selection"
width="55">
</el-table-column>
<el-table-column label="地点" align="center" prop="POHFCY_0"></el-table-column>
<el-table-column label="订单日期" width="100" align="center" prop="ORDDAT_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="BPRNAM_0" show-overflow-tooltip></el-table-column>
<el-table-column label="订单号" width="180" align="center" prop="POHNUM_0"></el-table-column>
<el-table-column label="行号" width="100" align="center" prop="POPLIN_0"></el-table-column>
<el-table-column label="项目号" width="150" align="center" prop="PJT_0"></el-table-column>
<el-table-column label="项目名称" width="150" align="center" prop="PJTNAM_0" show-overflow-tooltip></el-table-column>
<el-table-column label="产品" width="150" 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="ITMDES2_0" show-overflow-tooltip></el-table-column>
<el-table-column label="数量(采购)" width="100" align="center" prop="QTYUOM_0"></el-table-column>
<el-table-column label="采购单位" width="100" align="center" prop="UOM_0"></el-table-column>
<el-table-column label="采购说明" width="150" align="center" prop="POHITMDES1_0" show-overflow-tooltip></el-table-column>
<el-table-column label="数量" width="100" align="center" prop="QTYSTU_0"></el-table-column>
<el-table-column label="库存单位" width="100" align="center" prop="STU_0"></el-table-column>
<el-table-column label="未收采购数量" width="100" align="center" prop="NRCPQTYPUU_0"></el-table-column>
<el-table-column label="未收库存数量" width="100" align="center" prop="NRCPQTYSTU_0"></el-table-column>
<el-table-column label="本次收量(采购单位)" width="200" align="center" prop="THISQTYUOM">
<div class="item" slot-scope="scope">
<el-input class="item__input" v-model="scope.row.THISQTYUOM" placeholder="请输入内容"></el-input>
<div class="item__txt">{{scope.row.THISQTYUOM}}</div>
</div>
</el-table-column>
<el-table-column label="本次收量(库存单位)" width="200" align="center" prop="THISQTYSTU">
<div class="item" slot-scope="scope">
<el-input class="item__input" v-model="scope.row.THISQTYSTU" placeholder="请输入内容"></el-input>
<div class="item__txt">{{scope.row.THISQTYSTU}}</div>
</div>
</el-table-column>
<el-table-column label="库存状态" width="100" align="center" prop="STA_0">
<div class="item" slot-scope="scope">
<el-select class="item__input" v-model="scope.row.STA_0" placeholder="请选择">
<el-option v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<div class="item__txt">{{foodLabel(scope.row.STA_0)}}</div>
</div>
</el-table-column>
<el-table-column label="计量单位/存货单位系数" width="100" align="center" prop="UOMSTUCOE_0" show-overflow-tooltip></el-table-column>
<el-table-column label="材料" align="center" prop="ITMDES3_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-row>
<script>
var app = new Vue({
el: "#XWMSPOH",
data() {
return {
form: {
address: '',
billno: '',
supply: '',
materialcode: ''
},
addressList: [{
value: 'QCT',
label: 'QCT'
}, {
value: 'SBD',
label: 'SBD'
}],
options: [{
value: 'A',
label: 'A'
}, {
value: 'Q',
label: 'Q'
}, {
value: 'R',
label: 'R'
}],
billTable: [],
// 需要编辑的属性
editProp: ['THISQTYUOM', 'THISQTYSTU', 'STA_0'],
multipleSelection: []
};
},
mounted: function () {
// 获取所有单据编码
// $.ajax({
// type: "post",
// dataType: "json",
// data: {},
// url: "/xwms/XWMSPOH/Search",
// success: function (json) {
// app.billTable = json.Data;
// },
// error: function (json) {
// alert("加载失败");
// }
// });
},
computed: {
foodLabel() {
return (val) => {
return this.options.find(o => o.value === val).label
}
}
},
methods: {
/** 鼠标移入cell */
handleCellEnter(row, column, cell, event) {
const property = column.property
if (this.editProp.includes(property)) {
cell.querySelector('.item__input').style.display = 'block'
cell.querySelector('.item__txt').style.display = 'none'
}
},
/** 鼠标移出cell */
handleCellLeave(row, column, cell, event) {
const property = column.property
if (this.editProp.includes(property)) {
cell.querySelector('.item__input').style.display = 'none'
cell.querySelector('.item__txt').style.display = 'block'
}
},
// handleCellClick(row, column, cell, event) {
// console.log(row.STA_0);
// },
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
},
url: "/xwms/XWMSPOH/Search",
success: function (json) {
app.billTable = json.Data;
},
error: function (json) {
alert("加载失败");
}
});
},
create() {
var _this = this;
console.log(_this.multipleSelection);
var _this = this;
$.ajax({
type: "post",
dataType: "json",
data: {
data: _this.multipleSelection
},
url: "/xwms/XWMSPOH/Create",
success: function (json) {
if (json.Code == 200) {
_this.$message({
message: "创建成功!"
});
_this.$refs.multipleTable.clearSelection();
}
},
error: function (json) {
alert("加载失败");
}
});
}
},
});
</script>
+11
View File
@@ -118,5 +118,16 @@ namespace HHWMS.Web.Models
/// 默认质量状态
/// </summary>
public string STA_0 { get; set; }
/// <summary>
/// 本次收量(采购单位)
/// </summary>
public decimal THISQTYUOM { get; set; }
/// <summary>
/// 本次收量(库存单位)
/// </summary>
public decimal THISQTYSTU { get; set; }
}
}