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.
 
 
 
 

969 lines
47 KiB

@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Index.cshtml";
}
@*<meta http-equiv="refresh" content="1">*@
@*<meta http-equiv="refresh" content="1" url="{:url('~/SRM/BicDoc_Seller/ICSBiddingAdd_Seller')}" />*@
<link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
<script src="~/Content/js/select2/select2.min.js"></script>
<style>
#Tool {
background: #988c8c;
position: absolute;
width: 200px;
height: 100px;
top: 20px;
right: 50px;
}
</style>
<!--指定页面中div[id=dq]进行刷新-->
<script type="text/javascript">
var Time = '@System.Web.Configuration.WebConfigurationManager.ConnectionStrings["Time"].ConnectionString';
debugger;
$(document).ready(function () {
setInterval("startRequest()", Time);
});
</script>
<script>
debugger;
var list = "";
var BidCode = decodeURI($.request("BidCode"));
var Status = decodeURI($.request("status"))
var WorkPoints = $.request("WorkPoint");
var BidType = decodeURI($.request("BidType"))
var expArrivalDate = $
var Price = '';
var PriceHidd = '';
var RowsIDs = '';
function startRequest() {
var BidStatus = $("#txt_BidStatusTB").val();
debugger;
if (BidType == "明标") {
$.ajax({
//url: "/SRM/BicDoc_Seller/GetICSBidDoc" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
url: "/SRM/BicDoc_Seller/GetICSBidDocInfoSum?BidCode=" + BidCode + "&WorkPoint=" + WorkPoints + "&Status=" + BidStatus,
dataType: "json",
async: false,
success: function (data) {
$("#txt_RowNum").val(data.rows[0].rn);
}
});
}
}
$(function () {
debugger;
//InitControl();
if (!!BidCode) {
GetDetails();
}
gridList();
//获取文件-采购上传
GetCGFile();
GetVenDorFile();
})
function GetCGFile() {
debugger;
var Fules = '';
$.ajax({
//url: "/SRM/BicDoc_Seller/GetICSBidDoc" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
url: "/SRM/BicDoc_Seller/GetCGFile?BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
dataType: "json",
async: false,
success: function (data) {
debugger;
Fules = data.rows[0].Filename;
}
});
debugger
var innerhtml = '';
if (Fules != "" && Fules != null) {
debugger;
Fules = Fules.substring(0, Fules.length - 1);
var File = Fules.split(';');
for (var i = 0; i < File.length; i++) {
innerhtml += " <a href='../../../File/ZTBFile/" + BidCode + "/" + File[i] + "' download='" + File[i] + "' style='color:blue;'>" + File[i] + "</a><br>";
}
$("#hidbtnYL").html(innerhtml);
}
}
function GetVenDorFile() {
debugger;
var Fules = '';
$.ajax({
//url: "/SRM/BicDoc_Seller/GetICSBidDoc" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
url: "/SRM/BicDoc_Seller/GetVenDorFileTB?BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
dataType: "json",
async: false,
success: function (data) {
debugger;
Fules = data.rows[0].VendorFileName;
}
});
debugger
var innerhtml = '';
if (Fules != "" && Fules != null) {
debugger;
Fules = Fules.substring(0, Fules.length - 1);
var File = Fules.split(';');
for (var i = 0; i < File.length; i++) {
innerhtml += " <a href='../../../File/GYSZTBFile/" + BidCode + "/" + File[i] + "' download='" + File[i] + "' style='color:blue;'>" + File[i] + "</a>";
}
$("#hidbtn").html(innerhtml);
}
}
function GetDetails() {
$.ajax({
//url: "/SRM/BicDoc_Seller/GetICSBidDoc" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
url: "/SRM/BicDoc_Seller/GetICSBidDocInfoSum?BidCode=" + BidCode + "&WorkPoint=" + WorkPoints + "&Status=" + Status,
dataType: "json",
async: false,
success: function (data) {
debugger;
$("#txt_BidCode").val(data.rows[0].BidCode);
$("#txt_BidUser").val(data.rows[0].BidUser);
$("#txt_BidName").val(data.rows[0].BidName);
$("#txt_BidStatus").val(data.rows[0].BidStatus);
$("#txt_BidStatusTB").val(data.rows[0].Statuss);
$("#txt_StarTime").val(data.rows[0].StarTime);
$("#txt_EndTime").val(data.rows[0].EndTime);
$("#txt_Remark").val(data.rows[0].Remark);
$("#txtID").val(data.rows[0].ID);
$("#txt_YBBCounrt").val(data.rows[0].YBBCount);
$("#txt_WYBCounrt").val(data.rows[0].RowCounts - data.rows[0].YBBCount);
$("#txt_SumPrice").val(data.rows[0].Amount);
if (BidType == "明标") {
$("#txt_RowNum").val(data.rows[0].rn);
}
//$("#txt_TBCount").val(data.rows[0].TBCount);
if (data.rows[0].BidCode != '') {
$("#txt_BidCode").attr("disabled", "disabled");
$("#txt_BidUser").attr("disabled", "disabled");
$("#txt_BidName").attr("disabled", "disabled");
$("#txt_BidStatus").attr("disabled", "disabled");
$("#txt_StarTime").attr("disabled", "disabled");
$("#txt_EndTime").attr("disabled", "disabled");
$("#txt_Remark").attr("disabled", "disabled");
$("#txt_YBBCounrt").attr("disabled", "disabled");
$("#txt_WYBCounrt").attr("disabled", "disabled");
$("#txt_SumPrice").attr("disabled", "disabled");
$("#txt_RowNum").attr("disabled", "disabled");
//$("#txt_TBCount").attr("disabled", "disabled");
//$("#txt_BidCode").val(data.STNO);
//$("#txt_F_RealName").val(data.VenCode);
//$("#txt_BidName").val(data.VenCode);
//$("#txt_BidStatus").val(data.VenCode);
//$("#txt_StarTime").val(data.VenCode);
//$("#txt_EndTime").val(data.VenCode);
//$("#txt_Remark").val(data.VenCode);
}
}
});
}
function GetDetailsScrah() {
var BidStatus = $("#txt_BidStatusTB").val();
$.ajax({
//url: "/SRM/BicDoc_Seller/GetICSBidDoc" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
url: "/SRM/BicDoc_Seller/GetICSBidDocInfoSum?BidCode=" + BidCode + "&WorkPoint=" + WorkPoints + "&Status=" + BidStatus,
dataType: "json",
async: false,
success: function (data) {
debugger;
$("#txt_BidCode").val(data.rows[0].BidCode);
$("#txt_BidUser").val(data.rows[0].BidUser);
$("#txt_BidName").val(data.rows[0].BidName);
//$("#txt_BidStatus").val(data.rows[0].BidStatus);
$("#txt_StarTime").val(data.rows[0].StarTime);
$("#txt_EndTime").val(data.rows[0].EndTime);
$("#txt_Remark").val(data.rows[0].Remark);
$("#txtID").val(data.rows[0].ID);
$("#txt_YBBCounrt").val(data.rows[0].YBBCount);
$("#txt_WYBCounrt").val(data.rows[0].RowCounts - data.rows[0].YBBCount);
$("#txt_SumPrice").val(data.rows[0].Amount);
if (BidType == "明标") {
$("#txt_RowNum").val(data.rows[0].rn);
}
//$("#txt_TBCount").val(data.rows[0].TBCount);
if (data.rows[0].BidCode != '') {
$("#txt_BidCode").attr("disabled", "disabled");
$("#txt_BidUser").attr("disabled", "disabled");
$("#txt_BidName").attr("disabled", "disabled");
$("#txt_BidStatus").attr("disabled", "disabled");
$("#txt_StarTime").attr("disabled", "disabled");
$("#txt_EndTime").attr("disabled", "disabled");
$("#txt_Remark").attr("disabled", "disabled");
$("#txt_YBBCounrt").attr("disabled", "disabled");
$("#txt_WYBCounrt").attr("disabled", "disabled");
$("#txt_SumPrice").attr("disabled", "disabled");
$("#txt_RowNum").attr("disabled", "disabled");
//$("#txt_TBCount").attr("disabled", "disabled");
//$("#txt_BidCode").val(data.STNO);
//$("#txt_F_RealName").val(data.VenCode);
//$("#txt_BidName").val(data.VenCode);
//$("#txt_BidStatus").val(data.VenCode);
//$("#txt_StarTime").val(data.VenCode);
//$("#txt_EndTime").val(data.VenCode);
//$("#txt_Remark").val(data.VenCode);
}
}
});
}
//function InitControl() {
// var $VenCode = $("#BidUser");
// $VenCode.select2({
// allowClear: true,
// escapeMarkup: function (m) {
// return m;
// }
// });
// $.ajax({
// url: "/SRM/BicDoc_Publish/GetBidUser" + "?" + Math.random(),
// dataType: "json",
// async: false,
// success: function (data) {
// $.each(data, function (index, item) {
// BidUser.append("<option value='" + item.F_Account + "'>&nbsp;" + item.F_RealName + "</option>");
// });
// }
// });
//}
// function gridList() {
// document.getElementById("gridPanel").innerHTML = ' <table id="gridList"></table><div id="gridPager"></div> ';//重置grid
// var $gridList = $("#gridList");
// debugger;
// $gridList.dataGrid({
// url: "/SRM/BicDoc_Seller/SearchBidDocBDInfoByBidCodeSeller" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
// height: $(window).height() - 350,
// width: $(window).width() - 400,
// cellEdit: true,
// colModel: [
// { label: "ID", name: "ID", hidden: true },
// { label: "IID", name: "IID", hidden: true },
// { label: "DID", name: "DID", hidden: true },
// //{ label: '行号', name: 'RowNo', width: 50, align: 'left' },
// { label: '物料编码', name: 'InvCode', width: 80, align: 'left' },
// { label: "物料名称", name: "InvName", width: 150, align: 'left' },
// { label: "规格型号", name: "InvStd", width: 100, align: 'left' },
// { label: '计划采购数量', name: 'Quantity', width: 50, align: 'left' },
// { label: '单位', name: 'Unit', width: 50, align: 'left' },
// { label: '交期', name: 'DeliveryTime', width: 100, align: 'left' },
// { label: '来源', name: 'Source', width: 50, align: 'left' },
// { label: '备注', name: 'Remarks', width: 100, align: 'left' },
// { label: '是否应标', name: 'IsCast', width: 100, align: 'left', edittype: 'select',editable: true , editoptions: { value: GetSelectICSBadCode(), } },
// { label: '应标单价(人民币未税)', name: 'WSCastPrice', width: 120, align: 'left', editable: true, editrules: { number: true } },
// {
// label: '税额', name: 'TaxAmount', width: 80, align: 'center', editable: true,
// editrules: {
// number: true,
// //required: true,//必填设置
// custom: true,
// custom_func: function (value, colname) {
// if (value < 0) {
// return [false, colname + '必须为正数'];
// } else {
// return [true];
// }
// }
// }
// },
// { label: '应标单价(人民币含税)', name: 'CastPrice', width: 120, align: 'left', editable: true, editrules: { number: true } },
// //{ label: '投标次数', name: 'TBCount', width: 50, align: 'left' },
// { label: '比较', name: 'CastPriceHidd', hidden: true },
// { label: " 产地/品牌/规格/原卷价格", name: "Remark", width: 150, align: 'left', editable: true },
///* { label: '币种', name: 'Currency', width: 130, align: 'center', editable: true },*/
// {
// label: '币种', name: 'Currency', width: 130, align: 'center', edittype: 'select', editoptions: { value: GetItemCode(), }, editable: true, size: '50px', fontWeight: 'bolder',
// // 设置默认值为人民币
// formatter: function (cellvalue, options, rowObject) {
// return cellvalue || "人民币";
// },
// unformat: function (cellvalue, options, cell) {
// return cellvalue || "人民币";
// }
// },
// { label: '最小包装量', name: 'MinPackQuantity', width: 130, align: 'center', editable: true },
// { label: '最小起定量', name: 'MOQ', width: 130, align: 'center', editable: true },
// {
// label: '货期(天)', name: 'Futures', width: 150, align: 'center', editable: true,
// editrules: {
// number: true,
// //required: true,//必填设置
// custom: true,
// custom_func: function (value, colname) {
// if (value < 0) {
// return [false, colname + '必须为正数'];
// } else {
// return [true];
// }
// }
// }
// },
// { label: '供应商全称', name: 'VenFullName', width: 130, align: 'center', editable: true },
// { label: '采购员', name: 'Purchaser', width: 130, align: 'center', editable: true },
// { label: '产地', name: 'Origin', width: 130, align: 'center', editable: true },
// { label: '当日金属价格', name: 'DailyMetalPrices', width: 130, align: 'center', editable: true },
// { label: '加工费', name: 'ProcessingFee', width: 130, align: 'center', editable: true },
// { label: '汇率', name: 'ExchangeRate', width: 100, align: 'center', editable: true, editrules: { number: true } },
// { label: '关税', name: 'Tariff', width: 100, align: 'center', editable: true, editrules: { number: true } },
// { label: '运输费', name: 'TransportFee', width: 100, align: 'center', editable: true, editrules: { number: true } },
// { label: '贸易方式', name: 'TradeMethod', width: 100, align: 'center', editable: true },
// { label: '增值税', name: 'VAT', width: 100, align: 'center', editable: true, editrules: { number: true } }
// ],
// afterSaveCell: function (rowid, cellname, value) {
// debugger;
// //总扣分数加其他扣分数
// if (cellname === 'CastPrice') {
// Price = Number(value);
// if (Price < 0) {
// $.modalAlert("请输入大于0的单价!");
// return;
// }
// PriceHidd = Number($gridList.jqGrid("getCell", rowid, 'CastPriceHidd'));
// RowsIDs = rowid;
// if (PriceHidd != 0) {
// if (Price > PriceHidd) {
// $("#gridList").jqGrid('setCell', rowid, "CastPrice", PriceHidd);
// $.modalAlert("价格不可大于上一次提交价格");
// return;
// }
// }
// //if (Number(Price) > Number(PriceHidd) && Number(PriceHidd) > 0) {
// // $.modalAlert("如需应标,请填写应标单价!");
// // $gridList.jqGrid("setCell", rowid, 'CastPrice', PriceHidd);
// // return;
// //}
// }
// var obj_vendor = $("#gridList");
// var SUM_ZJ = 0;
// var rowIds_vendor = obj_vendor.getDataIDs();
// if (rowIds_vendor.length > 0) {
// debugger;
// for (var i = 0; i < rowIds_vendor.length; i++) {
// var vendorRowData = obj_vendor.getRowData(rowIds_vendor[i]);
// var SUM_ZJZH = Number(vendorRowData.CastPrice * vendorRowData.Quantity).toFixed(2);
// SUM_ZJ = Number(SUM_ZJ) + Number(SUM_ZJZH);
// }
// }
// $("#txt_SumPrice").val(SUM_ZJ);
// },
// gridComplete: function () {
// debugger;
// //设置select
// var RowDatas = $("#gridList").jqGrid('getDataIDs');
// for (var j = 0; j < RowDatas.length; j++) {
// var IsCast = $("#gridList").jqGrid("getCell", RowDatas[j], "IsCast");
// if (IsCast == "否") {
// if (BidType == "明标") {
// $("#txt_RowNum").val("未投标");
// }
// }
// }
// },
// pager: "#gridPager",
// sortname: 'RowNo',
// viewrecords: true,
// cellsubmit: "clientArray",
// shrinkToFit: false,
// autoScroll: true,//设置水平滚动条
// rowNum: 200
// });
// $("#refresh").click(function () {
// var queryJson = {
// CartonNo: CartonNo,
// }
// $gridList.jqGrid('setGridParam', {
// postData: { queryJson: JSON.stringify(queryJson) },
// page: 1
// }).trigger('reloadGrid');
// });
// }
// function GetItemCode() {
// var str = ":;人民币:人民币;欧元:欧元;美元:美元";
// return str;
// }
function gridList() {
document.getElementById("gridPanel").innerHTML = ' <table id="gridList"></table><div id="gridPager"></div> ';
var $gridList = $("#gridList");
// 定义所有列,包括额外的币种相关字段
var colModel = [
{ label: "ID", name: "ID", hidden: true },
{ label: "IID", name: "IID", hidden: true },
{ label: "DID", name: "DID", hidden: true },
{ label: '物料编码', name: 'InvCode', width: 80, align: 'left' },
{ label: "物料名称", name: "InvName", width: 150, align: 'left' },
{ label: "规格型号", name: "InvStd", width: 100, align: 'left' },
{ label: '计划采购数量', name: 'Quantity', width: 50, align: 'left' },
{ label: '单位', name: 'Unit', width: 50, align: 'left' },
{ label: '交期', name: 'DeliveryTime', width: 100, align: 'left' },
{ label: '来源', name: 'Source', width: 50, align: 'left' },
{ label: '备注', name: 'Remarks', width: 100, align: 'left' },
{ label: '是否应标', name: 'IsCast', width: 100, align: 'left', edittype: 'select', editable: true, editoptions: { value: GetSelectICSBadCode(), } },
{ label: '应标单价(人民币未税)', name: 'WSCastPrice', width: 120, align: 'left', editable: true, editrules: { number: true } },
{
label: '税额', name: 'TaxAmount', width: 80, align: 'center', editable: true,
editrules: {
number: true,
custom: true,
custom_func: function (value, colname) {
if (value < 0) {
return [false, colname + '必须为正数'];
} else {
return [true];
}
}
}
},
{ label: '应标单价(人民币含税)', name: 'CastPrice', width: 120, align: 'left', editable: true, editrules: { number: true } },
{ label: '比较', name: 'CastPriceHidd', hidden: true },
{ label: " 产地/品牌/规格/原卷价格", name: "Remark", width: 150, align: 'left', editable: true },
{
label: '币种', name: 'Currency', width: 130, align: 'center', edittype: 'select', editoptions: { value: GetItemCode(), }, editable: true, size: '50px', fontWeight: 'bolder',
formatter: function (cellvalue, options, rowObject) {
return cellvalue || "人民币";
},
unformat: function (cellvalue, options, cell) {
return cellvalue || "人民币";
}
},
{ label: '最小包装量', name: 'MinPackQuantity', width: 130, align: 'center', editable: true },
{ label: '最小起定量', name: 'MOQ', width: 130, align: 'center', editable: true },
{
label: '货期(天)', name: 'Futures', width: 150, align: 'center', editable: true,
editrules: {
number: true,
custom: true,
custom_func: function (value, colname) {
if (value < 0) {
return [false, colname + '必须为正数'];
} else {
return [true];
}
}
}
},
{ label: '供应商全称', name: 'VenFullName', width: 130, align: 'center', editable: true },
{ label: '采购员', name: 'Purchaser', width: 130, align: 'center', editable: true },
{ label: '产地', name: 'Origin', width: 130, align: 'center', editable: true },
{ label: '当日金属价格', name: 'DailyMetalPrices', width: 130, align: 'center', editable: true },
{ label: '加工费', name: 'ProcessingFee', width: 130, align: 'center', editable: true },
{ label: '汇率', name: 'ExchangeRate', width: 100, align: 'center', editable: true, editrules: { number: true }, hidden: true },
{ label: '关税', name: 'Tariff', width: 100, align: 'center', editable: true, editrules: { number: true }, hidden: true },
{ label: '增值税', name: 'VAT', width: 100, align: 'center', editable: true, editrules: { number: true }, hidden: true },
{ label: '国际运输费', name: 'TransportFee', width: 100, align: 'center', editable: true, editrules: { number: true }, hidden: true },
{ label: '贸易方式', name: 'TradeMethod', width: 100, align: 'center', editable: true, hidden: true },
];
// 币种相关列的名称数组
var currencyRelatedColumns = ['ExchangeRate', 'Tariff', 'VAT', 'TransportFee', 'TradeMethod'];
$gridList.dataGrid({
url: "/PNSRM/BicDoc_Seller/SearchBidDocBDInfoByBidCodeSeller" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
height: $(window).height() - 350,
width: $(window).width() - 400,
cellEdit: true,
colModel: colModel,
afterSaveCell: function (rowid, cellname, value) {
// 价格验证逻辑...
// 当币种变更时,调整列显示
if (cellname === 'Currency') {
var rowData = $gridList.jqGrid('getRowData', rowid);
toggleCurrencyColumns(rowData.Currency);
}
// 计算总价逻辑...
},
gridComplete: function () {
// 检查第一行的币种并调整列显示
var rowDatas = $("#gridList").jqGrid('getDataIDs');
if (rowDatas.length > 0) {
var currency = $("#gridList").jqGrid("getCell", rowDatas[0], "Currency");
toggleCurrencyColumns(currency);
}
// 设置select逻辑...
},
pager: "#gridPager",
sortname: 'RowNo',
viewrecords: true,
cellsubmit: "clientArray",
shrinkToFit: false,
autoScroll: true,
rowNum: 200
});
// 根据币种切换列的显示/隐藏
function toggleCurrencyColumns(currency) {
var $grid = $("#gridList");
// 遍历所有币种相关列
currencyRelatedColumns.forEach(function (colName) {
// 如果不是人民币,显示这些列;否则隐藏
if (currency !== "人民币") {
$grid.jqGrid('showCol', colName);
} else {
$grid.jqGrid('hideCol', colName);
}
});
}
// 刷新按钮逻辑...
}
function GetItemCode() {
var str = ":;人民币:人民币;欧元:欧元;美元:美元;英镑:英镑;日元:日元;港币:港币;澳元:澳元;新西兰元:新西兰元;瑞典克朗:瑞典克朗;韩币:韩币;新加坡元:新加坡元;加元:加元;卢布:卢布;南非兰特:南非兰特;卢比:卢比;泰铢:泰铢";
return str;
}
//获取不良原因
function GetSelectICSBadCode() {
var str = "1:是;0:否";
return str;
}
//刷新
function reloadData() {
STNO = $("#STNO").text();
var queryJson = {
STNO: STNO,
}
$("#gridList").jqGrid('setGridParam', {
postData: { queryJson: JSON.stringify(queryJson) },
page: 1
}).trigger('reloadGrid');
}
function formatDate(fomatType, date) {
let ret;
let valueDate = date;
if (!date) valueDate = new Date()
let opt = {
"Y+": valueDate.getFullYear().toString(), // 年
"m+": (valueDate.getMonth() + 1).toString(), // 月
"d+": valueDate.getDate().toString(), // 日
"H+": valueDate.getHours().toString(), // 时
"M+": valueDate.getMinutes().toString(), // 分
"S+": valueDate.getSeconds().toString() // 秒
};
for (let k in opt) {
ret = new RegExp("(" + k + ")").exec(fomatType);
if (ret) {
fomatType = fomatType.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
};
};
return fomatType;
}
//确定提交
function submitForm() {
debugger;
$("#gridList").find($("td[aria-describedby='gridList_rn']")).click();//提交取消编辑状态
var Remark = $("#txt_Remark").val();
//var TBCount = $("#txt_TBCount").val();
var myDate = new Date;
var DateFormt = formatDate("YYYY-mm-dd HH:MM:SS", myDate)
var EndTime = $("#txt_EndTime").val();
var IsCast = "";
var IDlist = "";
var Details = [];
if (DateFormt > EndTime) {
$.modalAlert("投票截止日期已过 无法保存价格!");
return;
}
//else if (Status == "已投标") {
// $.modalAlert("已投标,请取消提交再进行投标!");
// return;
//}
var obj_vendor = $("#gridList");
var rowIds_vendor = obj_vendor.getDataIDs();
var arrayData_vendor = new Array();
if (rowIds_vendor.length > 0) {
debugger;
for (var i = 0; i < rowIds_vendor.length; i++) {
var vendorRowData = obj_vendor.getRowData(rowIds_vendor[i]);
if (vendorRowData.IsCast == "是") {
if (PriceHidd != 0) {
if (Price > PriceHidd) {
$("#gridList").jqGrid('setCell', rowid, "CastPrice", PriceHidd);
$.modalAlert("价格不可大于上一次提交价格");
return;
}
}
if (vendorRowData.Currency == "人民币") {
if (vendorRowData.CastPrice < 0) {
$.modalAlert("请输入大于0的应标单价(人民币含税)!");
return;
}
if (vendorRowData.WSCastPrice == "") {
$.modalAlert("应标单价(人民币未税)为必填项目,请填写!");
return;
}
if (vendorRowData.TaxAmount == "") {
$.modalAlert("税额为必填项目,请填写!");
return;
}
if (vendorRowData.MinPackQuantity == "") {
$.modalAlert("最小包装量为必填项目,请填写!");
return;
}
if (vendorRowData.MOQ == "") {
$.modalAlert("最小起定量为必填项目,请填写!");
return;
}
if (vendorRowData.Futures == "") {
$.modalAlert("货期(天)为必填项目,请填写!");
return;
}
} else {
if (vendorRowData.CastPrice < 0) {
$.modalAlert("请输入大于0的应标单价(人民币含税)!");
return;
}
if (vendorRowData.WSCastPrice == "") {
$.modalAlert("应标单价(人民币未税)为必填项目,请填写!");
return;
}
if (vendorRowData.TaxAmount == "") {
$.modalAlert("税额为必填项目,请填写!");
return;
}
if (vendorRowData.ExchangeRate == "") {
$.modalAlert("汇率为必填项目,请填写!");
return;
}
if (vendorRowData.Tariff == "") {
$.modalAlert("关税为必填项目,请填写!");
return;
}
if (vendorRowData.VAT == "") {
$.modalAlert("增值税为必填项目,请填写!");
return;
}
if (vendorRowData.TransportFee == "") {
$.modalAlert("国际运输费为必填项目,请填写!");
return;
}
if (vendorRowData.TradeMethod == "") {
$.modalAlert("贸易方式为必填项目,请填写!");
return;
}
}
//if (vendorRowData.TBCount=="0") {
// $.modalAlert("投标次数为0无法再次投标!");
// return;
//}
if (vendorRowData.CastPrice == "0" || vendorRowData.CastPrice == "") {
$.modalAlert("如需应标,请填写应标单价!");
return;
}
if (Remark == "板材类") {
$.modalAlert("标的为板材类,如需应标,请填写产地/品牌/规格/原卷价格!");
return;
}
}
if (vendorRowData.IsCast == "否") {
IsCast = 0;
} else {
IsCast = 1;
}
var obj = {
ID: vendorRowData.DID,
InfoID: vendorRowData.IID,
BDID: vendorRowData.ID,
IsCast: IsCast,
CastPrice: vendorRowData.CastPrice,
BidCode: BidCode,
Remarks: vendorRowData.Remark,
WorkPoint: WorkPoints,
WSCastPrice: vendorRowData.WSCastPrice == "" ? 0 : vendorRowData.WSCastPrice,
TaxAmount: vendorRowData.TaxAmount == "" ? 0 : vendorRowData.TaxAmount,
Currency: vendorRowData.Currency,
MinPackQuantity: vendorRowData.MinPackQuantity == "" ? 0 : vendorRowData.MinPackQuantity,
MOQ: vendorRowData.MOQ == "" ? 0 : vendorRowData.MOQ,
Futures: vendorRowData.Futures,
VenFullName: vendorRowData.VenFullName,
Purchaser: vendorRowData.Purchaser,
Origin: vendorRowData.Origin,
DailyMetalPrices: vendorRowData.DailyMetalPrices == "" ? 0 : vendorRowData.DailyMetalPrices,
ProcessingFee: vendorRowData.ProcessingFee == "" ? 0 : vendorRowData.ProcessingFee,
ExchangeRate: vendorRowData.ExchangeRate == "" ? 0 : vendorRowData.ExchangeRate,
Tariff: vendorRowData.Tariff == "" ? 0: vendorRowData.Tariff,
VAT: vendorRowData.VAT == "" ? 0 : vendorRowData.VAT,
TransportFee: vendorRowData.TransportFee=="" ? 0 : vendorRowData.TransportFee,
TradeMethod: vendorRowData.TradeMethod,
};
arrayData_vendor.push(obj);
}
var arrayVendor = JSON.stringify(arrayData_vendor);
$.modalConfirm("确定是否提交当前价格?提交后无法撤回。", function (r) {
if (r) {
$.submitFormNOClose({
url: "/PNSRM/BicDoc_Seller/SaveForm" + "?" + Math.random(),
type: "POST",
data: {
arrayShellFabricDetail: arrayVendor,
},
//dataType: "json",
//async: false,
//success: function (data) {
// $.currentWindow().$("#gridList").trigger("reloadGrid");
//},
param: { arrayShellFabricDetail: arrayVendor },
success: function () {
$("#txt_BidStatusTB").val("已投标");
//var BidStatus = $("#txt_BidStatusTB").val();
//$.currentWindow().$("#gridList").trigger("reloadGrid");
GetDetailsScrah();
gridList();
}
});
}
})
}
}
function UpLoadFile(fileinfo) {
debugger;
//$("#CurrentPoCode").val(poCode);
var files = fileinfo.files;
var GUID = $("#txtID").val();
var BidCode = $("#txt_BidCode").val();
var fileName='';
for (var i = 0; i < files.length; i++) {
var regex = /\s/;
if (regex.test(files[i].name)) {
$.modalAlert("文件名:<span style='color: red;'>" + files[i].name + "</span>,包含空格,上传失败,请修改后重新上传!", "warning");
document.getElementById("FileUp").value = "";
return false;
}
fileName += ""+files[i].name+"";
if (fileName != null && fileName != "") {
var data = new FormData();
jQuery.each(jQuery('#FileUp')[0].files, function (i, file) {
data.append('file-' + i, file);
});
//data.append("STNO", $("#CurrentSTNO").val());
//var info = document.getElementById("form1");
//var formData = new FormData(info);
$.modalConfirm("确定上传文件吗?", function (r) {
if (r) {
$.ajax({
url: "/SRM/BicDoc_Seller/UpLoadFileImport" + "?" + Math.random() + "&BidCode=" + BidCode + "&ID=" + GUID,
type: "post",
data: data,
contentType: false,
processData: false,
success: function (data) {
if (data != "" && data != "获取文件失败" && data != "上传文件失败") {
$.ajax({
//url: "/SRM/BicDoc_Seller/GetICSBidDoc" + "?" + Math.random() + "&BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
url: "/SRM/BicDoc_Seller/GetVenDorFileTB?BidCode=" + BidCode + "&WorkPoint=" + WorkPoints,
dataType: "json",
async: false,
success: function (data) {
debugger;
Fules = data.rows[0].VendorFileName;
}
});
debugger
var innerhtml = '';
if (Fules != "" && Fules != null) {
debugger;
Fules = Fules.substring(0, Fules.length - 1);
var File = Fules.split(';');
for (var i = 0; i < File.length; i++) {
innerhtml += " <a href='../../../File/GYSZTBFile/" + BidCode + "/" + File[i] + "' download='" + File[i] + "' style='color:blue;'>" + File[i] + "</a>";
}
$("#hidbtn").html(innerhtml);
}
$.modalAlert("上传成功");
//$("#CurrentSTNO").val(fileName);
////$.currentWindow().$("#gridList").trigger("reloadGrid");
}
else {
$.modalAlert("异常:" + data);
}
},
error: function (aa) {
$.modalAlert("上传失败:" + aa);
}
});
}
});
}
}
document.getElementById("FileUp").value = "";
}
function UpLoadFiles(STNO) {
$("#FileUp").click();
}
</script>
@*<form id="form1">
<div style="padding-top: 20px; margin-right: 20px;">
<table class="form">
<tr>
<td class="formTitle">招标编号:</td>
<td class="input-group">
<div class="input-group">
<input id="txt_BidCode" name="txt_BidCode" type="text" class="form-control" placeholder="招标编号" />
</div>
</td>
<td class="formTitle">招标负责人:</td>
<td class="formValue">
<select id="BidUser" name="BidUser" class="form-control select2" placeholder="请选择供应商..."></select>
<input type="hidden" id="hidetext" />
</td>
</tr>
<tr>
<td class="formTitle">标案名称:</td>
<td class="input-group">
<input id="txt_BidName" name="txt_BidName" class="form-control" type="text" placeholder="标案名称" />
</td>
<td class="formTitle">招标状态:</td>
<td class="input-group">
<input id="txt_BidStatus" name="txt_BidStatus" class="form-control" type="text" placeholder="标案名称" />
<input type="hidden" id="hidetext" />
</td>
</tr>
<tr>
<td class="formTitle">投标开始日期:</td>
<td class="input-group">
<input id="txt_StarTime" name="txt_StarTime" type="text" class="form-control required" style="width:70%;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="预计到货时间" />
</td>
<td class="formTitle">投标截止日期:</td>
<td class="input-group">
<input id="txt_EndTime" name="txt_EndTime" type="text" class="form-control required" style="width:70%;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="预计到货时间" />
</td>
</tr>
<tr>
<td class="formTitle">招标备注:</td>
<td class="input-group">
<input id="txt_Remark" name="txt_Remark" type="text" class="form-control" style="width:70%;" maxlength="10" placeholder="标案名称" />
</td>
</tr>
</table>
</div>
<div class="gridPanel">
<table id="gridList"></table>
<div id="gridPager"></div>
</div>
</form>*@
<form id="form1">
<div id="Tool"style="position:absolute;width:18%;height:30%;top:3%;right:5%">
<input id="txt_RowNum" name="txt_RowNum" type="text" style="width: 98%;height:99%;text-align:center;font-size:200px;color:red"maxlength="10" />
</div>
<div style="position:absolute;width:18%;height:8%;top:33%;right:5%">
<h1 style="text-align: center; color: #5BC0DE">当前排名</h1>
</div>
<div style="padding-top: 20px; margin-right: 20px;">
<table class="form">
<tr>
<th class="formTitle">招标编号:</th>
<td class="formValue">
<input id="txt_BidCode" name="txt_BidCode" type="text" class="form-control required" style="width:70%;" maxlength="10" />
<input id="txtID" type="text" class="form-control" style="display:none" />
</td>
<th class="formTitle">招标负责人:</th>
<td class="formValue">
<input id="txt_BidUser" name="txt_BidUser" type="text" class="form-control required" style="width:70%;" maxlength="10" />
</td>
</tr>
<tr>
<th class="formTitle">标案名称:</th>
<td class="formValue">
<input id="txt_BidName" name="txt_BidName" type="text" class="form-control required" style="width:70%;" maxlength="10" />
</td>
<th class="formTitle">招标状态:</th>
<td class="formValue">
<input id="txt_BidStatus" name="txt_BidStatus" type="text" class="form-control required" style="width:70%;" maxlength="10" />
<input id="txt_BidStatusTB" name="txt_BidStatusTB" type="text" class="form-control required" style="width:70%;display:none" maxlength="10" />
</td>
</tr>
<tr>
<th class="formTitle">投标开始日期:</th>
<td class="formValue">
<input id="txt_StarTime" name="txt_StarTime" type="text" class="form-control required" style="width:70%;" maxlength="10" />
</td>
<th class="formTitle">投标截止日期:</th>
<td class="formValue">
<input id="txt_EndTime" name="txt_EndTime" type="text" class="form-control required" style="width:70%;" maxlength="10" />
</td>
</tr>
<tr>
<th class="formTitle">应标项目数:</th>
<td class="formValue">
<input id="txt_YBBCounrt" name="txt_YBBCounrt" type="text" class="form-control required" style="width:70%;" maxlength="10" />
</td>
<th class="formTitle">未应标项目数:</th>
<td class="formValue">
<input id="txt_WYBCounrt" name="txt_WYBCounrt" type="text" class="form-control required" style="width:70%;" maxlength="10" />
</td>
</tr>
<tr>
<th class="formTitle">招标备注:</th>
<td class="formValue">
<input id="txt_Remark" name="txt_Remark" type="text" class="form-control required" style="width: 70%;" maxlength="10" />
</td>
<th class="formTitle" style="font-size:27px">投标总价:</th>
<td class="formValue">
<input id="txt_SumPrice" name="txt_SumPrice" type="text" class="form-control required" style="width:70%;font-size:30px" maxlength="10" />
</td>
@*<th class="formTitle">总价排名:</th>
<td class="formValue">
</td>*@
</tr>
@*<tr>
</tr>*@
@*<tr>
</tr>*@
<tr>
<th class="formTitle">采购附件:</th>
<td class="formValue" colspan="2">
<div id="hidbtnYL" style=" border: 1px #edeff3 solid"></div>
</td>
</tr>
<tr>
<th class="formTitle">附件名称:</th>
<td class="formValue" colspan="3">
@*<input id="fileName" name="fileName" class="form-control" readonly="readonly" style="width:600px" />*@
<div id="hidbtn" style=" border: 1px #edeff3 solid"></div>
</td>
<td class="formValue">
<input id='FileUp' type='file' style="display: none" onchange="UpLoadFile(this)" multiple="multiple" />
<button id="btn_FileUp" class="btn btn-info" type="button" onclick="UpLoadFiles(this)">上传附件</button>
</td>
</tr>
</table>
</div>
<div class="gridPanel" id="gridPanel">
<table id="gridList"></table>
<div id="gridPager"></div>
</div>
</form>