|
|
|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GoodsReportPrice.aspx.cs"
|
|
|
|
|
Inherits="TradeManageNew.CaiGou.GoodsReportPrice" %>
|
|
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
|
|
|
|
|
|
<head>
|
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
|
<title>采购信息</title>
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/icon.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/New.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/DataGrid.css" />
|
|
|
|
|
<script src="../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/jquery.min.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/DataGrid.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/DataPager.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/DateBox.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/Global2.js?t=1" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/jquery.bgiframe.min.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/Global.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/jquery.url.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/WindowLoad.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/jquery.cookies.min.js" type="text/javascript"></script>
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox2.1/source/jquery.fancybox.css?v=2.1.5"
|
|
|
|
|
media="screen" />
|
|
|
|
|
<script type="text/javascript" src="../Scripts/fancybox2.1/lib/jquery.mousewheel-3.0.6.pack.js"></script>
|
|
|
|
|
<script type="text/javascript" src="../Scripts/fancybox2.1/source/jquery.fancybox.js?v=2.1.5"></script>
|
|
|
|
|
|
|
|
|
|
<script src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
//# sourceURL=dynamicScript.js
|
|
|
|
|
//#region 全局变量
|
|
|
|
|
var Name = '<%= Session["Name"].ToString() %>';
|
|
|
|
|
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
|
|
|
|
|
var WindowLoadModel = new WindowLoad();
|
|
|
|
|
var IsNeed = 1;
|
|
|
|
|
var IsSafe = 0;
|
|
|
|
|
var State = 1;
|
|
|
|
|
var Target = "";
|
|
|
|
|
var newModel = null;
|
|
|
|
|
var newAllValor = 0;
|
|
|
|
|
var newAllCbm = 0;
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
|
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
|
|
|
WindowLoadModel.Isbgiframe = true;
|
|
|
|
|
WindowLoadModel.Load();
|
|
|
|
|
ajaxInit(WindowLoadModel);
|
|
|
|
|
Target = $.url.param("Target");
|
|
|
|
|
if (Target == undefined) {
|
|
|
|
|
Target = "";
|
|
|
|
|
}
|
|
|
|
|
$("#txt_BuyName").val(Name);
|
|
|
|
|
CreateDataGrid();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ReadData();
|
|
|
|
|
GetClientList();
|
|
|
|
|
$("#" + datagrid1.TableID + " a[CommandName='cmdLook']").live("click", function () {
|
|
|
|
|
|
|
|
|
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
|
|
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
|
|
|
if (Target == "")
|
|
|
|
|
window.parent.addTab("货物编辑", "HuoWu/HW_GoodsAddForTM.aspx?Title=采购批次&GoodsId=" + model.GoodsId, true);
|
|
|
|
|
else
|
|
|
|
|
window.open("../HuoWu/HW_GoodsAddForTM.aspx?Title=采购批次&GoodsId=" + model.GoodsId);
|
|
|
|
|
});
|
|
|
|
|
//编辑
|
|
|
|
|
$("#" + datagrid1.TableID + " input[CommandName='editQuote']").live("click", function () {
|
|
|
|
|
EditCol(this);
|
|
|
|
|
});
|
|
|
|
|
//删除
|
|
|
|
|
$("#" + datagrid1.TableID + " input[CommandName='deleteQuote']").live("click", function () {
|
|
|
|
|
DelCol(this);
|
|
|
|
|
});
|
|
|
|
|
$("#cmdSave").click(function () {
|
|
|
|
|
Save();
|
|
|
|
|
});
|
|
|
|
|
$("#ExportData").click(function () {
|
|
|
|
|
Save();
|
|
|
|
|
});
|
|
|
|
|
$("#select_Date").live("change", function () {
|
|
|
|
|
var selectedValue = this.value;
|
|
|
|
|
|
|
|
|
|
// 根据选中的值执行不同的操作
|
|
|
|
|
switch (selectedValue) {
|
|
|
|
|
case 'select_oneDate':
|
|
|
|
|
$("#txt_EDate").hide();
|
|
|
|
|
break;
|
|
|
|
|
case 'select_tweDate':
|
|
|
|
|
$("#txt_EDate").show();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
console.log('未选中任何选项');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#btn_sch").bind("click", function () {
|
|
|
|
|
ReadData();
|
|
|
|
|
});
|
|
|
|
|
$("#btn_Export").bind("click", function () {
|
|
|
|
|
ExportData();
|
|
|
|
|
});
|
|
|
|
|
$("#btn_Export2").bind("click", function () {
|
|
|
|
|
ExportData2();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 初始化DataGrid
|
|
|
|
|
function CreateDataGrid() {
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "报价单号";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind DTQuoteNo}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "客户";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind ClientName}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "产品名称";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind Nombre}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "单价";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind Recio}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "意向箱数";
|
|
|
|
|
col.CellTemplate = `{Bind orginData}`;
|
|
|
|
|
col.CellFormatter = function (data) {
|
|
|
|
|
var num = data.Cantidad
|
|
|
|
|
if (data.IsCustomerUpdate) {
|
|
|
|
|
return `<span class='ms' style="color:red">${num}</span>`
|
|
|
|
|
} else {
|
|
|
|
|
return `<span class='ms'>${num}</span>`
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "总体积";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind AllCbm}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "总金额";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind Valor}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "产品图片";
|
|
|
|
|
col.CellTemplate = '<img src="../{Bind Foto}" width="180px" height="150px" id="img_1"/>';
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "箱率";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind QtyOrCtn}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "体积";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind Cbm}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "毛重";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind Gw}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "净重";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind Nw}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "产品型号";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind Modelo}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "描述";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind Caracteristicas}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "城市名称";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind CityName}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "工厂名称";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind FactoryName}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "工厂图片";
|
|
|
|
|
col.CellTemplate = '<img src="../{Bind FactoryImg}" width="180px" height="150px"/>';
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "操作员工";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind UpdateName}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "报价时间";
|
|
|
|
|
col.CellTemplate = "<span class='ms'>{Bind newCreateDate}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "操作";
|
|
|
|
|
col.Width = "150px";
|
|
|
|
|
col.CellTemplate = "<input CommandName='editQuote' msg='{Bind Id}' class='btnClass dgbtnEdit' type='button' value='编辑'></input>";
|
|
|
|
|
col.CellTemplate += "<input CommandName='deleteQuote' msg='{Bind Id}' class='btnClass dgbtnEdit' type='button' value='删除'></input>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
datagrid1.SetPageSize(30);
|
|
|
|
|
datagrid1.SetPageIndex(1);
|
|
|
|
|
datagrid1.IsFixHeader = false;
|
|
|
|
|
datagrid1.ShowIndexColumn = false;
|
|
|
|
|
//datagrid1.SortExpression = " GoodsCode";
|
|
|
|
|
datagrid1.ViewSortDirection = "desc";
|
|
|
|
|
datagrid1.AllowPaging = true;
|
|
|
|
|
datagrid1.Width = "100%";
|
|
|
|
|
datagrid1.SelectMode = nblf.ui.SelectMode.CheckBox;
|
|
|
|
|
datagrid1.Init();
|
|
|
|
|
datagrid1.Sorting(function () {
|
|
|
|
|
ReadData();
|
|
|
|
|
});
|
|
|
|
|
datagrid1.add_PageIndexChanged(function () { ReadData(); });
|
|
|
|
|
};
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 保存
|
|
|
|
|
function Save() {
|
|
|
|
|
var error = CreateSaveModel("MainTable", newModel);
|
|
|
|
|
if (error != "") { alert(error); return; }
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.Model = newModel;
|
|
|
|
|
//param.Model.ClientId = [];
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../SysManageServiceNew.asmx/Edit_DT_Quote_NewTable",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
if (data.d.result) {
|
|
|
|
|
ReadData();
|
|
|
|
|
alert("保存成功");
|
|
|
|
|
$.fancybox.close();
|
|
|
|
|
newModel = null
|
|
|
|
|
ReadData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 获取时间
|
|
|
|
|
function GetNewDate(newDate) {
|
|
|
|
|
// 创建Date对象
|
|
|
|
|
var dateObject = new Date(newDate);
|
|
|
|
|
|
|
|
|
|
// 格式化日期和时间
|
|
|
|
|
var year = dateObject.getFullYear();
|
|
|
|
|
var month = (dateObject.getMonth() + 1).toString().padStart(2, '0'); // 月份是从0开始的,所以需要+1
|
|
|
|
|
var day = dateObject.getDate().toString().padStart(2, '0');
|
|
|
|
|
var hours = dateObject.getHours().toString().padStart(2, '0');
|
|
|
|
|
var minutes = dateObject.getMinutes().toString().padStart(2, '0');
|
|
|
|
|
var seconds = dateObject.getSeconds().toString().padStart(2, '0');
|
|
|
|
|
|
|
|
|
|
// 构建格式化后的字符串
|
|
|
|
|
var formattedString = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
|
|
return formattedString;
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 编辑DataGrid
|
|
|
|
|
function EditCol(obj) {
|
|
|
|
|
var RowIndex = $(obj).parentsUntil("tr").parent().attr("index");
|
|
|
|
|
var Model = datagrid1.Get_Model(RowIndex);
|
|
|
|
|
newModel = Model;
|
|
|
|
|
CreateGetModel("MainTable", Model);
|
|
|
|
|
ShowFancybox("MainTable");
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 显示弹出窗体
|
|
|
|
|
function ShowFancybox(id) {
|
|
|
|
|
$.fancybox({
|
|
|
|
|
'scrolling': 'no',
|
|
|
|
|
'autoScale': false,
|
|
|
|
|
'transitionIn': 'elastic',
|
|
|
|
|
'transitionOut': 'elastic',
|
|
|
|
|
'href': '#' + id,
|
|
|
|
|
'onClosed': function () {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}, 0);
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 读取数据
|
|
|
|
|
function ReadData() {
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.ClientId = $("#select_client").val() == 0 || $("#select_client").val() == null ? -1 : $("#select_client").val();
|
|
|
|
|
if (document.getElementById('select_Date').value == 'select_oneDate') {
|
|
|
|
|
param.StartDate = $("#txt_SDate").val();
|
|
|
|
|
param.EndDate = $("#txt_SDate").val();
|
|
|
|
|
} else {
|
|
|
|
|
param.StartDate = $("#txt_SDate").val();
|
|
|
|
|
param.EndDate = $("#txt_EDate").val();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
param.search = $("#txt_search").val();
|
|
|
|
|
param.FactoryName = $("#txt_FactoryName").val();
|
|
|
|
|
param.UserName = $("#txt_UserName").val();
|
|
|
|
|
param.Sort = $("#txt_Sort").val() + " " + datagrid1.ViewSortDirection;
|
|
|
|
|
param.PageSize = datagrid1.Get_PageSize();
|
|
|
|
|
param.PageIndex = datagrid1.Get_PageIndex();
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../SysManageServiceNew.asmx/GetList_DT_QuoteTable",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
data.d.data.datas.forEach(item => {
|
|
|
|
|
item.orginData = JSON.parse(JSON.stringify(item))
|
|
|
|
|
})
|
|
|
|
|
var newDatas = data.d.data.datas;
|
|
|
|
|
$(newDatas).each(function (i) {
|
|
|
|
|
newDatas[i].newCreateDate = GetNewDate(newDatas[i].CreateDate);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
datagrid1.Set_RowCount(data.d.data.total);
|
|
|
|
|
datagrid1.DataBind(newDatas);
|
|
|
|
|
document.getElementById('newAllCbm').textContent = data.d.data.newAllCbm;
|
|
|
|
|
document.getElementById('newAllValor').textContent = data.d.data.newAllValor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 获取客户列表
|
|
|
|
|
function GetClientList() {
|
|
|
|
|
$("#select_client").empty();
|
|
|
|
|
//if (AllShop == "1")
|
|
|
|
|
$("#select_client").append("<option value='0'>全部</option>");
|
|
|
|
|
//var param = new Object();
|
|
|
|
|
|
|
|
|
|
//param.DeptId = "0";
|
|
|
|
|
//param.PlatType = "0";
|
|
|
|
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../SysManageServiceNew.asmx/GetClientList",
|
|
|
|
|
//data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
async: false,
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
$(data.d.data.datas).each(function (i) {
|
|
|
|
|
$("#select_client").append("<option value='" + this.Id + "'>" + this.ClientName + "</option>");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 删除
|
|
|
|
|
function DelCol(obj) {
|
|
|
|
|
|
|
|
|
|
if (window.confirm('确定要删除吗?') == false) return;
|
|
|
|
|
//开始删除
|
|
|
|
|
var RowIndex = $(obj).parentsUntil("tr").parent().attr("index");
|
|
|
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
|
|
|
var QuoteId = model.Id != null ? model.Id : -1;
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.QuoteIdList = [];
|
|
|
|
|
param.QuoteIdList.push(QuoteId);
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../SysManageServiceNew.asmx/Delete_DT_QuoteNewTableList",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
if (data.d.result) {
|
|
|
|
|
alert("删除成功");
|
|
|
|
|
ReadData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 导出
|
|
|
|
|
function ExportData() {
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
/*debugger*/
|
|
|
|
|
//查询条件
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.ClientId = $("#select_client").val() == 0 || $("#select_client").val() == null ? -1 : $("#select_client").val();
|
|
|
|
|
var fnameClient = $("#select_client").val() == 0 || $("#select_client").val() == null ? -1 : $("#select_client").val();
|
|
|
|
|
if (document.getElementById('select_Date').value == 'select_oneDate') {
|
|
|
|
|
param.StartDate = $("#txt_SDate").val();
|
|
|
|
|
param.EndDate = $("#txt_SDate").val();
|
|
|
|
|
} else {
|
|
|
|
|
param.StartDate = $("#txt_SDate").val();
|
|
|
|
|
param.EndDate = $("#txt_EDate").val();
|
|
|
|
|
}
|
|
|
|
|
param.search = $("#txt_search").val();
|
|
|
|
|
param.FactoryName = $("#txt_FactoryName").val();
|
|
|
|
|
param.UserName = $("#txt_UserName").val();
|
|
|
|
|
param.Sort = $("#txt_Sort").val() + " " + datagrid1.ViewSortDirection;
|
|
|
|
|
param.PageSize = datagrid1.Get_PageSize();
|
|
|
|
|
param.PageIndex = datagrid1.Get_PageIndex();
|
|
|
|
|
|
|
|
|
|
//excel名称
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var selectElement = document.getElementById('select_client');
|
|
|
|
|
var selectedValue = selectElement.value;
|
|
|
|
|
var newClientName = selectElement.options[selectElement.selectedIndex].text;
|
|
|
|
|
var fname = param.StartDate == '' ? `报价单(客户:${newClientName}).xls` : `报价单(客户:${newClientName} 报价日期:${param.StartDate}-${param.EndDate}).xls`;
|
|
|
|
|
//debugger
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../SysManageServiceNew.asmx/Get_DT_QuoteNewExcel",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
|
|
|
|
debugger
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
params = { FilePath: data.d.data, FileName: fname };
|
|
|
|
|
|
|
|
|
|
window.location = "../GlobalAshx/DownFile.ashx?" + jQuery.param(params);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 导出
|
|
|
|
|
function ExportData2() {
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
|
|
|
|
|
//查询条件
|
|
|
|
|
var param = new Object();
|
|
|
|
|
var list = datagrid1.GetSelectListModel();
|
|
|
|
|
if (list == null) {
|
|
|
|
|
alert("请选择要采购的sku");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var ids = [];
|
|
|
|
|
$(list).each(function () {
|
|
|
|
|
ids.push(this.Id)
|
|
|
|
|
});
|
|
|
|
|
//excel名称
|
|
|
|
|
param.Ids = ids;
|
|
|
|
|
|
|
|
|
|
var selectElement = document.getElementById('select_client');
|
|
|
|
|
var selectedValue = selectElement.value;
|
|
|
|
|
var newClientName = selectElement.options[selectElement.selectedIndex].text;
|
|
|
|
|
var fname = `报价单(勾选导出).xls`;
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../SysManageServiceNew.asmx/Get_DT_QuoteNewExcel2",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
params = { FilePath: data.d.data, FileName: fname };
|
|
|
|
|
|
|
|
|
|
window.location = "../GlobalAshx/DownFile.ashx?" + jQuery.param(params);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
<body class="headbody">
|
|
|
|
|
<form>
|
|
|
|
|
<div class="title_ico">商品报价</div>
|
|
|
|
|
<table id="tb1" class="tableAll" style="width: 100%;">
|
|
|
|
|
<tr id="tr2">
|
|
|
|
|
<td class="f1" width="10%">客户:</td>
|
|
|
|
|
<td width="10%">
|
|
|
|
|
<select id="select_client" class="selectClass" style="width: 120px" name="D7"></select></td>
|
|
|
|
|
<td class="f1" style="width: 10%;">
|
|
|
|
|
<select id="select_Date" class="selectClass" style="width: 90px" name="D5">
|
|
|
|
|
<option value="select_oneDate">单日日期:</option>
|
|
|
|
|
<option value="select_tweDate">起止日期:</option>
|
|
|
|
|
</select></td>
|
|
|
|
|
<td width="20%">
|
|
|
|
|
<input id="txt_SDate" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" />
|
|
|
|
|
<input id="txt_EDate" class="editTextbox" onfocus="WdatePicker()" style="width: 120px; display: none;" type="text" />
|
|
|
|
|
</td>
|
|
|
|
|
<td class="f1" style="width: 10%;">关键词搜索:</td>
|
|
|
|
|
<td width="10%">
|
|
|
|
|
<input id="txt_search" class="editTextbox" style="width: 120px;" type="text" />
|
|
|
|
|
</td>
|
|
|
|
|
<td class="f1" style="width: 10%;">排序:</td>
|
|
|
|
|
<td width="10%">
|
|
|
|
|
<select id="txt_Sort" class="selectClass" style="width: 90px" name="D5">
|
|
|
|
|
<option value="CreateDate">报价时间</option>
|
|
|
|
|
<option value="AllCbm">商品体积</option>
|
|
|
|
|
</select>
|
|
|
|
|
</td>
|
|
|
|
|
<%-- <td>
|
|
|
|
|
<input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" /></td>--%>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr id="tr3">
|
|
|
|
|
|
|
|
|
|
<td class="f1" style="width: 10%;">工厂名称:</td>
|
|
|
|
|
<td width="10%">
|
|
|
|
|
<input id="txt_FactoryName" class="editTextbox" style="width: 120px;" type="text" />
|
|
|
|
|
</td>
|
|
|
|
|
<td class="f1" style="width: 10%;">操作员工:</td>
|
|
|
|
|
<td width="10%">
|
|
|
|
|
<input id="txt_UserName" class="editTextbox" style="width: 120px;" type="text" />
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td>
|
|
|
|
|
<input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" /></td>
|
|
|
|
|
<td class="f1" style="width: 10%;"><input id="btn_Export" class="btnClass btnClassAdd" type="button" value="搜索条件导出报价单" " /></td>
|
|
|
|
|
<td class="f1" style="width: 10%;"><input id="btn_Export2" class="btnClass btnClassAdd" type="button" value="勾选导出报价单"" /></td>
|
|
|
|
|
<%-- <td class="f1" style="width: 10%;"><input id="btn_add" class="btnClass btnClassAdd" type="button" value="搜索条件导出报价单" onclick="ExportData();" /></td>
|
|
|
|
|
<td class="f1" style="width: 10%;"><input id="btn_add2" class="btnClass btnClassAdd" type="button" value="勾选导出报价单" onclick="ExportData2();" /></td>--%>
|
|
|
|
|
</tr>
|
|
|
|
|
<%-- <tr id="tr7">
|
|
|
|
|
<td colspan="1">
|
|
|
|
|
<input id="btn_add" class="btnClass btnClassAdd" type="button" value="搜索条件导出报价单" onclick="ExportData();" />
|
|
|
|
|
</td>
|
|
|
|
|
<td colspan="1">
|
|
|
|
|
<input id="btn_add2" class="btnClass btnClassAdd" type="button" value="勾选导出报价单" onclick="ExportData2();" />
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
</tr>--%>
|
|
|
|
|
<tr id="tr8">
|
|
|
|
|
<td colspan="2">查询结果总体积(单位/立方米):</td>
|
|
|
|
|
<td colspan="1" id="newAllCbm">0</td>
|
|
|
|
|
<td colspan="2">查询结果总金额(单位/人民币):</td>
|
|
|
|
|
<td colspan="1" id="newAllValor">0</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td valign="top" colspan="9">
|
|
|
|
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</form>
|
|
|
|
|
<div style="display: none;">
|
|
|
|
|
<div id="MainTable" title="编辑" style="width: 400px; height: auto;">
|
|
|
|
|
<table class="tableAll" style="width: 100%;">
|
|
|
|
|
<colgroup>
|
|
|
|
|
<col style="width: 80px;" />
|
|
|
|
|
<col />
|
|
|
|
|
</colgroup>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1">名称</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id='Nombre' type='text' style='width: 99%' columnname="Nombre" columndesc="名称" columnrequired="false" validtype="" /></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1">型号</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id='Modelo' type='text' style='width: 99%' columnname="Modelo" columndesc="型号" columnrequired="false" validtype="" /></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1">描述</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id='Caracteristicas' type='text' style='width: 99%' columnname="Caracteristicas" columndesc="描述" columnrequired="false" validtype="" /></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1">每箱数量</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id='QtyOrCtn' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="QtyOrCtn" columndesc="每箱数量" columnrequired="true" /></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1">体积</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id='Cbm' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="Cbm" columndesc="体积" columnrequired="true" /></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1">毛重</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id='Gw' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="Gw" columndesc="毛重" columnrequired="true" /></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1">净重</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id='Nw' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="Nw" columndesc="净重" columnrequired="true" /></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1">单价</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id='Recio' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="Recio" columndesc="单价" columnrequired="true" /></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1">意向箱数</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id='Cantidad' type='text' style='width: 99%' precision="0" min="0" max="99999" columnname="Cantidad" columndesc="意向箱数" columnrequired="true" /></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="4" align="center">
|
|
|
|
|
<input id="cmdSave" type="button" value="保存" />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
|
|
</html>
|