You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
337 lines
14 KiB
337 lines
14 KiB
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Index.cshtml";
|
|
}
|
|
<script src="~/Content/js/datepicker/WdatePicker.js"></script>
|
|
<script>
|
|
$(document).ready(function () {
|
|
$("input.cell").keyup(function (e) {
|
|
switch (e.keyCode) {
|
|
// up arrow
|
|
case 40:
|
|
$(this).parent()
|
|
.parent()
|
|
.next()
|
|
.children("td")
|
|
.children("input.cell[name="
|
|
+ $(this).attr("name") + "]")
|
|
.focus();
|
|
break;
|
|
|
|
// down arrow
|
|
case 38:
|
|
$(this).parent()
|
|
.parent()
|
|
.prev()
|
|
.children("td")
|
|
.children("input.cell[name="
|
|
+ $(this).attr("name") + "]")
|
|
.focus();
|
|
break;
|
|
}
|
|
});
|
|
});</script>
|
|
<script>
|
|
$(function () {
|
|
gridList();
|
|
})
|
|
|
|
function gridList() {
|
|
|
|
var $gridList = $("#gridList");
|
|
var queryJson = {
|
|
QUOTATIONCODE: $("#txt_QUOTATIONCODE").val(),
|
|
RFQCODE: $("#txt_RFQCODE").val(),
|
|
RFQName: $("#txt_RFQName").val(),
|
|
ItemCode: $("#txt_ItemCode").val(),
|
|
ItemName: $("#txt_ItemName").val(),
|
|
BeginDate: $("#txt_BeginDate").val(),
|
|
EndDate: $("#txt_EndDate").val(),
|
|
StatusNew: $("#cb-StatusNew").val(),
|
|
StatusPublish: $("#cb-StatusPublish").val(),
|
|
StatusClose: $("#cb-StatusClose").val(),
|
|
ReleaseState: $("#selShow").val(),
|
|
|
|
|
|
}
|
|
$gridList.dataGrid({
|
|
cellEdit: true,
|
|
url: "/SRM/PriceInquiry/GetGridJsonByPN" + "?" + Math.random(),
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
height: $(window).height() - 270,
|
|
width: $(window).width() - 300,
|
|
colModel: [
|
|
{ label: "主键", name: "ASNID", hidden: true, key: true },
|
|
{
|
|
label: '操作', width: 100, align: 'center',
|
|
formatter: btnLook
|
|
},
|
|
{ label: '报价单单号', name: 'QUOTATIONCODE', width: 250, align: 'left' },
|
|
/* { label: '采购组织', name: 'PURCHUGNAME', width: 100, align: 'left' },*/
|
|
{ label: '询价单单号', name: 'RFQCODE', width: 250, align: 'left' },
|
|
{ label: '询价单名称', name: 'RFQNAME', width: 250, align: 'left' },
|
|
|
|
//{
|
|
// label: '物料类型', name: 'ITEMTYPE', width: 100, align: 'left',
|
|
// formatter: function (cellvalue) {
|
|
// if (cellvalue == "Real") {
|
|
// return "正式物料";
|
|
// } else if (cellvalue == "Temp") {
|
|
// return "临时物料";
|
|
// }
|
|
// else { return ""; }
|
|
// }
|
|
//},
|
|
{
|
|
label: '单据状态', name: 'STATUS', width: 100, align: 'left', hidden: true,
|
|
formatter: function (cellvalue) {
|
|
if (cellvalue == "New") {
|
|
return "新增";
|
|
} else if (cellvalue == "Publish") {
|
|
return "已发布";
|
|
}
|
|
else if (cellvalue == "Close") {
|
|
return "关闭";
|
|
}
|
|
else { return ""; }
|
|
}
|
|
},
|
|
{
|
|
label: '报价单状态', name: 'QUOSTATUS', width: 60, align: 'left',
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
debugger;
|
|
var html = "";
|
|
if (rowObject.QUOSTATUS == "YBJ") {
|
|
html += '<span class=\'label label-success\'>已报价</span>';
|
|
} else if (rowObject.QUOSTATUS == "PricingApprove") {
|
|
html += '<span class=\'label label-warning\'>定价通过</span>';
|
|
} else if (rowObject.QUOSTATUS == "Back") {
|
|
html += '<span class=\'label label-danger\'>退回</span>';
|
|
} else if (rowObject.QUOSTATUS == "WBJ") {
|
|
html += '<span class=\'label label-danger\'>未报价</span>';
|
|
}
|
|
return cellvalue = html;
|
|
}
|
|
},
|
|
{ label: '询价单创建日期', name: 'CREATEDATE', width: 150, align: 'left' },
|
|
{ label: '创建人', name: 'CREATEUSER', width: 100, align: 'left' },
|
|
{ label: 'WorkPoint', name: 'WorkPoint', width: 100, align: 'left',hidden:true },
|
|
{ label: '报价单创建时间', name: 'LOGTIME', hidden: true },
|
|
],
|
|
|
|
gridComplete: function () {
|
|
},
|
|
pager: "#gridPager",
|
|
|
|
sortorder: "desc",
|
|
//sortname:'LOGTIME asc,CREATEDATE desc',
|
|
sortname: "CREATEDATE",
|
|
viewrecords: true,
|
|
//multiselect: true,
|
|
|
|
gridComplete: function () {
|
|
var strIds = $("#gridList").jqGrid("getDataIDs");
|
|
for (var i = 0; i < strIds.length; i++) {
|
|
var strValue = $("#gridList").jqGrid("getCell", strIds[i], "STATUS");//得到单元格数据
|
|
if (strValue == "3")
|
|
$("#" + strIds[i]).find("td").css("background-color", "pink");
|
|
}
|
|
},
|
|
rowNum: 10000
|
|
});
|
|
|
|
$("#warehouse a.btn-default").click(function () {
|
|
$("#warehouse a.btn-default").removeClass("active");
|
|
$(this).addClass("active");
|
|
$('#btn_search').trigger("click");
|
|
});
|
|
debugger;
|
|
//需要优化
|
|
$("#btn_search").click(function () {
|
|
if ($("#cb-StatusNew").prop('checked') == true) {
|
|
debugger;
|
|
$("#cb-StatusNew").val("New");
|
|
}
|
|
if ($("#cb-StatusPublish").prop('checked') == true) {
|
|
$("#cb-StatusPublish").val('Publish');
|
|
}
|
|
if ($("#cb-StatusClose").prop('checked') == true) {
|
|
$("#cb-StatusClose").val('Close')
|
|
}
|
|
var warehouse = $("#warehouse a.active").attr('data-value');
|
|
var queryJson = {
|
|
QUOTATIONCODE: $("#txt_QUOTATIONCODE").val(),
|
|
RFQCODE: $("#txt_RFQCODE").val(),
|
|
RFQName: $("#txt_RFQName").val(),
|
|
ItemCode: $("#txt_ItemCode").val(),
|
|
ItemName: $("#txt_ItemName").val(),
|
|
BeginDate: $("#txt_BeginDate").val(),
|
|
EndDate: $("#txt_EndDate").val(),
|
|
ReleaseState: $("#selShow").val(),
|
|
|
|
StatusNew: $("#cb-StatusNew").val(),
|
|
StatusPublish: $("#cb-StatusPublish").val(),
|
|
StatusClose: $("#cb-StatusClose").val(),
|
|
}
|
|
$gridList.jqGrid('setGridParam', {
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
}).trigger('reloadGrid');
|
|
});
|
|
}
|
|
function btnLook(cellvalue, options, rowObject) {
|
|
//return cellvalue = "<a class=\"btn btn-info dropdown-text\" onclick=\"UpLoadClick('" + rowObject.RFQCODE + "','" + rowObject.QUOTATIONCODE + "')\">报价</a>";
|
|
if (rowObject.STATUS == 'Publish') {
|
|
return cellvalue = "<a class=\"btn btn-info dropdown-text\" onclick=\"UpLoadClick('" + rowObject.RFQCODE + "','" + rowObject.QUOTATIONCODE + "','" + rowObject.STATUS + "','" + rowObject.WorkPoint + "')\">报价</a>";
|
|
}
|
|
else {
|
|
return cellvalue = "<a class=\"btn btn-info dropdown-text\" onclick=\"UpLoadClick('" + rowObject.RFQCODE + "','" + rowObject.QUOTATIONCODE + "','" + rowObject.STATUS + "','" + rowObject.WorkPoint + "')\">查看</a>";
|
|
}
|
|
}
|
|
|
|
function UpLoadClick(RFQCODE, QUOTATIONCODE, STATUS, WorkPoint) {
|
|
//var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
|
|
//if (ids.length != 1) {
|
|
// $.modalAlert("请选择一行数据进行查看!");
|
|
// return;
|
|
//}
|
|
debugger;
|
|
if (QUOTATIONCODE == "暂未报价") {
|
|
QUOTATIONCODE = '';
|
|
}
|
|
$.modalOpen2({
|
|
id: "Cartonaddtest",
|
|
title: "详细信息",
|
|
url: "/SRM/PriceInquiry/QuotedPriceDetail?RFQCODE=" + RFQCODE + "&" + Math.random() + ""ATIONCODE=" + QUOTATIONCODE + "&STATUS=" + encodeURI(encodeURI(STATUS)) + "&WorkPoint=" + WorkPoint,
|
|
width: "95%",
|
|
height: "95%",
|
|
btn: null
|
|
});
|
|
}
|
|
|
|
|
|
|
|
|
|
debugger;
|
|
function ChcekboxChange() {
|
|
debugger;
|
|
$("#changechaeckbox").find("input[type='checkbox']").each(function (i, n) {
|
|
if ($(this).prop('checked') == false) {
|
|
$(this).val("");
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
</script>
|
|
<iframe id="ifrm" src="" width="0" height="0"></iframe>
|
|
|
|
|
|
|
|
|
|
<div class="topPanel" style="height:125px">
|
|
<div class="search">
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
<label>报价单单号:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_QUOTATIONCODE" type="text" class="form-control" placeholder="报价单编号" style="width: 150px;">
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<label> 询价单单号:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_RFQCODE" type="text" class="form-control" placeholder="询价单编号" style="width: 150px;">
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<label> 询价单名称:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_RFQName" type="text" class="form-control" placeholder="询价单名称" style="width: 150px;">
|
|
</div>
|
|
</td>
|
|
<td style="display:none">
|
|
<label> 物料编码:</label>
|
|
</td>
|
|
<td style="display:none">
|
|
<div class="input-group">
|
|
<input id="txt_ItemCode" type="text" class="form-control" placeholder="物料编码" style="width: 150px;">
|
|
</div>
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td style="display:none">
|
|
<label> 物料名称:</label>
|
|
</td>
|
|
<td style="display:none">
|
|
<div class="input-group">
|
|
<input id="txt_ItemName" type="text" class="form-control" placeholder="物料名称" style="width: 150px;">
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<label>开始时间(从):</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input type="text" name="txt_BeginDate" id="txt_BeginDate" class="form-control" style="width: 150px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="开始时间(从)" />
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<label> 开始时间(到):</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input type="text" name="txt_EndDate" id="txt_EndDate" class="form-control" style="width: 150px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd', minDate: txt_BeginDate.value })" placeholder="开始时间(到)" />
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<label> 询价状态:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<select id="selShow" name="F_Target" class="form-control" style="width: 100px;">
|
|
<option value="1">显示全部</option>
|
|
<option value="2">已报价</option>
|
|
<option value="0" selected="selected">未报价</option>
|
|
</select>
|
|
</div>
|
|
</td>
|
|
<td> </td>
|
|
<td>
|
|
<span class="input-group-btn">
|
|
<button id="btn_search" type="button" class="btn btn-info"><i class="fa fa-search"></i></button>
|
|
</span>
|
|
</td>
|
|
<td style="padding-left: 10px;"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="display:none">
|
|
<label> 单据状态:</label>
|
|
</td>
|
|
<td style="display:none">
|
|
<div class="input-group" id="changechaeckbox">
|
|
<input type="checkbox" name="State" value="" id="cb-StatusNew" style="width:30px" onchange="ChcekboxChange()" /><label for="cb-NoQuotedPrice">新增</label>
|
|
<input type="checkbox" name="State" value="" id="cb-StatusPublish" style="width:30px" onchange="ChcekboxChange()" /><label for="cb-QuotedPrice">已发布</label>
|
|
<input type="checkbox" name="State" value="" id="cb-StatusClose" style="width:30px" onchange="ChcekboxChange()" /><label for="cb-Close">关闭</label>
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="gridPanel">
|
|
<table id="gridList"></table>
|
|
<div id="gridPager"></div>
|
|
</div>
|
|
|
|
|