| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463 |
- @using System.Web.UI.HtmlControls
- @using ShwasherSys.Authorization.Permissions
- @using ShwasherSys.Models.Layout
- @using ShwasherSys.Models.Modal
- @{
- /**/
- ViewBag.ActiveMenu = PermissionNames.PagesSendGoodsOrderSendQueryMg; //The menu item will be active for this page.
- ViewBag.Title = "客户订单发货统计";
- List<SelectListItem> OrderSaleTypeList = ViewBag.OrderSaleType;
- List<SelectListItem> isDoBillList = new List<SelectListItem>();
- isDoBillList.AddRange(new List<SelectListItem>()
- {
- new SelectListItem()
- {
- Value = "0",
- Text="未开票"
- },new SelectListItem()
- {
- Value = "1",
- Text="已开票"
- }
- });
- //List<SelectListItem> yearList = new List<SelectListItem>();
- //DateTime loDate = DateTime.Now;
- //int currentYear = loDate.Year;
- //int currentMonth = loDate.Month;
- //loDate = loDate.AddYears(-2);
- //yearList.Add(new SelectListItem()
- //{
- // Value = loDate.Year+"",
- // Text = loDate.Year+"年"
- //});
- //for (int i = 0; i < 2; i++)
- //{
- // loDate = loDate.AddYears(1);
- // yearList.Add(new SelectListItem()
- // {
- // Value = loDate.Year+"",
- // Text = loDate.Year+"年"
- // });
- //}
- //List<SelectListItem> monthList = new List<SelectListItem>();
- //for (int i = 1; i <= 12; i++)
- //{
- // bool selected = i == currentMonth;
- // monthList.Add(new SelectListItem()
- // {
- // Value = i+"",
- // Text = i+"月份"
- // });
- //}
- var searchForm = new SearchFormViewModal(new List<SearchItem>()
- {
- new SearchItem("customerId", "客户编号").SetSearchIcon("query_customer_modal"),
- //new SearchItem("year", "订单日期").SetSearchItem(yearList,isAddBlank:false),
- //new SearchItem("month", "到").SetSearchItem(monthList,isAddBlank:false),
- new SearchItem("orderDate", "订单日期",FiledType.D,ExpType.GreaterOrEqual),
- new SearchItem("orderDate", "到",FiledType.D,ExpType.LessOrEqual),
- new SearchItem("isDoBill", "是否开票",FiledType.S,ExpType.Equal).SetSearchItem(isDoBillList),
- //new SearchItem("saleType", "内销/外销",FiledType.Inull,ExpType.Equal).SetSearchItem(OrderSaleTypeList),
- new SearchItem("productNo", "产品编码"),
- new SearchItem("model", "规格"),
- new SearchItem("material", "材质"),
- }, false);
- }
- @section css{
- <link href="~/Content/Plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
- <style>
- .table {
- width: 100%;
- max-width: 100%;
- margin-bottom: 1px;
- }
- .table thead {
- background: #d1dcf9;
- }
- .table th, .table td {
- text-align: center;
- max-width: 159px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .table tbody tr td{
- padding: 0 4px;
- cursor: pointer;
- font-size: 12px;
- line-height: 23.5px;
- }
- .table thead tr th:first-child, .table tbody tr td:first-child {
- border-left: .3px #ddd solid;
- }
- .table thead tr th:last-child, .table tbody tr td:last-child {
- border-right: .3px #ddd solid;
- }
- </style>
- }
- <div class="table-box mr-4 iwb-bootstrap-table">
- @Html.Action("ToolMenu", "Layout", new { pageName = ViewBag.ActiveMenu, searchForm })
- <table id="table"
- data-url="/api/services/app/OrderSend/GetViewOrderItemAll"
- data-striped="true" data-id-field="id" data-unique-id="id"
- data-method="post"
- data-side-pagination="server"
- data-content-type="application/x-www-form-urlencoded; charset=UTF-8"
- data-cache="false"
- data-pagination="true" data-page-size="50" data-page-number="1" data-page-list="[30,50,100,200]" data-pagination-detail-h-align="right" data-pagination-h-align="left"
- data-query-params="QueryParams"
- data-response-handler="ResponseHandler"
- data-click-to-select="true"
- data-single-select="true" >
- <thead>
- <tr class="row" id="header">
- <th data-field="state" data-checkbox="true"></th>
- <th data-align="center" data-field="customerId">客户编号</th>
- <th data-align="center" data-field="customerName">客户编号</th>
- <th data-align="center" data-field="orderDate">订单日期</th>
- <th data-align="center" data-field="stockNo" >客户订单号</th>
- <th data-align="center" data-field="orderNo">订单流水号</th>
- <th data-align="center" data-field="partNo" data-formatter="PartNoFormatter">零件号</th>
- <th data-align="center" data-field="sendDate" data-formatter="SendDateFormatter">送货日期</th>
- <th data-align="center" data-field="productNo">产品编号</th>
- <th data-align="center" data-field="productName">产品名称</th>
- <th data-align="center" data-field="sendQuantity" data-formatter="QuantityFormatter">数量</th>
- <th data-align="center" data-field="orderUnitName">单位</th>
- @*<th data-align="center" data-field="totalPrice" data-formatter="TotalPriceFormatter" data-footer-formatter="AllTotalPriceFormatter">总价</th>*@
- <th data-align="center" data-field="orderStickBillNo" data-formatter="InvoiceBillFormatter">发票号</th>
- <th data-align="center" data-field="statementBillNo" data-formatter="InvoiceBillFormatter">对账单号</th>
- </tr>
- </thead>
- </table>
- @*<th data-align="center" data-field="isReport" data-formatter="IsReportFormatter">检验报告</th>
- <th data-align="center" data-field="isPartSend" data-formatter="IsPartSendFormatter">部分送货</th>
- <th data-align="center" data-field="model">型号</th>
- <th data-align="center" data-field="surfaceColor">表色</th>
- <th data-align="center" data-field="material">材质</th>
- <th data-align="center" data-field="rigidity">硬度</th>*@
- @*<table class="table table-striped table-hover">
- <thead>
- <tr>
- <th>客户编号</th>
- <th>客户名称</th>
- <th>订单日期</th>
- <th>客户订单号</th>
- <th>订单流水号</th>
- <th>零件号</th>
- <th>发货日期</th>
- <th>产品编号</th>
- <th>产品名称</th>
- <th>发货数量</th>
- <th>单位</th>
- <th>发票号</th>
- <th>对账单号</th>
- </tr>
- </thead>
- <tbody>
-
- </tbody>
- </table>*@
- </div>
- @section modal{
- <section>
- @Html.Partial("Modals/Query/_Customer", "KeyWords-1")
- </section>
- }
- @section scripts
- {
- <script src="~/Content/Plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
- <script src="~/Content/Plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
- <script type="text/javascript">
- //cId cStockNo cOrderStatusId cCustomerId cStartDate cEndDate
- var datePickerOpt = {
- language: 'zh-CN',
- format: "yyyy-mm-dd",
- todayBtn: true,
- autoclose: true,
- startView: 2,
- minView: 2,
- maxView: 4
- //showSecond: true,
- //showHours: true,
- //minuteStep: 10
- };
- $(function () {
- //$("#KeyWords-2").datetimepicker(datePickerOpt);
- //$("#KeyWords-3").datetimepicker(datePickerOpt);
- var nowDate = new Date();
- var preDate = new Date(nowDate.getTime() - 7 * 24 * 60 * 60 * 1000);
- $("#KeyWords-2").val(preDate.Format("yyyy-MM-dd")).on("changeDate",
- function (e) {
- $("#KeyWords-3")
- .datetimepicker('setStartDate', e.date + 1000 * 60 * 60 * 24);
- $("#KeyWords-3")
- .datetimepicker('setEndDate', new Date(e.date.valueOf() + 1000 * 60 * 60 * 24 * 90));
- });
- $("#KeyWords-3").val(nowDate.Format("yyyy-MM-dd")).on("changeDate",
- function (e) {
- $("#KeyWords-2")
- .datetimepicker('setStartDate', new Date(e.date.valueOf() - 1000 * 60 * 60 * 24 * 90));
- $("#KeyWords-2")
- .datetimepicker('setEndDate', new Date(e.date.valueOf() - 1000 * 60 * 60 * 24 ));
- });
-
- //show完毕前执行
- LoadTable();
- //loadData();
- var funs = window.funs || { none: function () { console.log("No type"); } };
- //funs["btnUpdate"] = function () { BtnUpdate({ readonly: "standardName" }); };
- funs["btnExportExcel"] = function(url) {
- GetSearchList();
- $.iwbAjax4({
- url: url,
- data:_searchList,
- success: function(res) {
- window.location.href = res;
- }
- });
- }
-
- });
- //function BtnSearch(isCheck) {
- // loadData();
- //}
- function loadData() {
- GetSearchList();
- var queryObj= {
- SearchList: _searchList
- };
- SaveAjax({
- url: window.appUrl + "OrderSend/GetViewOrderItemAll",
- data: queryObj,
- isValidate: false,
- isAlert: false,
- success: function(res) {
- $(".table.table-striped tbody").empty();
- if (res && res.length > 0) {
- var allTotal = 0;
- res.forEach(function(v) {
- var $tr = $('<tr></tr>');
- $tr.append('<td>' + v.customerId + '</td>');
- $tr.append('<td>' + v.customerName + '</td>');
- $tr.append('<td>' + OrderDateFormatter(v.orderDate) + '</td>');
- $tr.append('<td>' + v.stockNo + '</td>');
- $tr.append('<td>' + v.orderNo + '</td>');
- $tr.append('<td>' + PartNoFormatter(v.partNo) + '</td>');
- $tr.append('<td>' + SendDateFormatter(v.sendDate) + '</td>');
- $tr.append('<td>' + v.productNo + '</td>');
- $tr.append('<td>' + v.productName + '</td>');
- $tr.append('<td>' + QuantityFormatter(v.sendQuantity) + '</td>');
- $tr.append('<td>' + v.orderUnitName + '</td>');
- $tr.append('<td>' + InvoiceBillFormatter(v.orderStickBillNo) + '</td>');
- $tr.append('<td>' + InvoiceBillFormatter(v.statementBillNo) + '</td>');
- $(".table.table-striped tbody").append($tr);
- allTotal += v.totalPrice;
- });
- //$(".table.table-striped tbody")
- // .append(
- // '<tr style="background:#d1dcf9;"><td colspan="5" style="text-align:right;">合计:</td><td colspan="6" style="text-align:right;padding-right:35px;">' +
- // allTotal +
- // 'CNY</td></tr>');
- }
- }
- });
- /*abp.ajax({
- url: window.appUrl +"OrderSend/GetViewOrderItemAll",
- async: true,
- data: JSON.stringify(queryObj),
- type: "Post",
- contentType: 'application/json',
- isValidate: false,
- dataType: "json",
- success: function (res) {
- $(".table.table-striped tbody").empty();
- if (res && res.length > 0) {
- var allTotal = 0;
- res.forEach(function(v) {
- var $tr = $('<tr></tr>');
- $tr.append('<td>' + v.customerId + '</td>');
- $tr.append('<td>' + OrderDateFormatter(v.orderDate) + '</td>');
- $tr.append('<td>' + v.stockNo + '</td>');
- $tr.append('<td>' + v.orderNo + '</td>');
- $tr.append('<td>' + v.partNo + '</td>');
- $tr.append('<td>' + SendDateFormatter(v.sendDate) + '</td>');
- $tr.append('<td>' + v.productNo + '</td>');
- $tr.append('<td>' + v.productName + '</td>');
- $tr.append('<td>' + QuantityFormatter(v.quantity) + '</td>');
- $tr.append('<td>' + v.orderUnitName + '</td>');
- $tr.append('<td>' + TotalPriceFormatter(v.totalPrice) + '</td>');
- $(".table.table-striped tbody").append($tr);
- allTotal += v.totalPrice;
- });
- $(".table.table-striped tbody").append('<tr><td colspan="5" style="text-align:right;">合计:</td><td colspan="6" style="text-align:right;padding-right:35px;color:red;">' + allTotal+'CNY</td></tr>');
- }
- }
- });*/
- }
-
- function PartNoFormatter(v) {
- if (v===null) {
- return "";
- }
- return v;
- }
- function OrderDateFormatter(v) {
- var orderDate = new Date(v);
- return '<span style="text-decoration:underline;" >' + orderDate.Format('yyyy-MM-dd') + '</span>';
- }
-
- function SendDateFormatter(v, r) {
- var dataNow = abp.clock.now();
- var sendDate = new Date(v);
- var s1 = dataNow.getTime(), s2 = sendDate.getTime();
- var span = (s2 - s1) / 1000;
- var dayspan = parseInt(span / (24 * 60 * 60));
- if (dayspan < 0) {
- return '<span style="text-decoration:underline;color:#ff0000" >' + sendDate.Format('yyyy-MM-dd') + '</span>';
- }
- if (dayspan > -1 && dayspan < 4) {
- return '<span style="text-decoration:underline;color:#dd4b39" >' + sendDate.Format('yyyy-MM-dd') + '</span>';
- }
- return '<span style="text-decoration:underline;" >' + sendDate.Format('yyyy-MM-dd') + '</span>';
- }
- function QuantityFormatter(v, r) {
- var str = '<span style="text-decoration:underline;" >' + v + '</span>';
- return str;
- }
- function TotalPriceFormatter(v, r) {
- var str = "0.00";
- if (v && v > 0) {
- v = (v * 10000) / 10000;
- str = _formatAmount(v, 4);
- }
- str = '<span style="text-decoration:underline;">' + str + ' ' + r+'</span>';
- return str;
- }
- function AllTotalPriceFormatter(data) {
- var count = 0;
- data.forEach(function (e) {
- count += e.totalPrice;
- });
- if (count && count > 0) {
- count = (count * 10000) / 10000;
- count = _formatAmount(count, 4);
- }
- return '<strong>' + count + ' CNY<strong>';
- }
- function InvoiceBillFormatter(invoiceBillNo) {
- if (invoiceBillNo) {
- return '<span class="label label-success">已开票(' + invoiceBillNo + ')</span>';
- } else {
- return '<span class="label label-warning">未开票</span>';
- }
- }
- </script>
- <script>
- // 对Date的扩展,将 Date 转化为指定格式的String
- // 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
- // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
- // 例子:
- // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
- // (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
- Date.prototype.Format = function (fmt) { //author: meizz
- var o = {
- "M+": this.getMonth() + 1, //月份
- "d+": this.getDate(), //日
- "h+": this.getHours(), //小时
- "m+": this.getMinutes(), //分
- "s+": this.getSeconds(), //秒
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
- "S": this.getMilliseconds() //毫秒
- };
- if (/(y+)/.test(fmt))
- fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
- for (var k in o)
- if (new RegExp("(" + k + ")").test(fmt))
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
- return fmt;
- }
- //将数字转换成金额显示 n是小数点后位数
- function toNumber(num, n) {
- var re = String(num);
- var dotfront = "";
- var dotlast = "";
- if (re.indexof('.') > -1) {
- var sarr = re.spilt('.');
- dotfront = sarr[0];
- dotlast = sarr[1];
- var dotlastlength = strlen(dotlast);
- if (dotlastlength < n) {
- for (var j = 0; j < n - dotlastlength; j++) {
- dotlast += "0";
- }
- }
- if (dotlastlength > n) {
- dotlast = dotlast.substr(0, n);
- }
- } else {
- dotfront = re;
- for (var i = 0; i < n; i++) {
- dotlast += "0";
- }
- }
- num = dotfront + '.' + dotlast;
- return num;
- }
- function _formatAmount(strData, n) {
- var CurrencyAndAmountRegExp = /^(\d{1,18})|(\d{1,18}\.)|(\d{1,17}\.\d{0,1})|(\d{1,16}\.\d{0,2})|(\.\d{1,2})$/;
- var _result = CurrencyAndAmountRegExp.test(strData);
- if (_result == false) {
- return strData;
- } // 一般来说最多就6位吧,当然如果有特殊需求可自行更改(`・∀・´)
- n = n > 0 && n <= 6 ? n : 2;
- var formatData = parseFloat((strData + '').replace(/[^\d\.-]/g, '')).toFixed(n) + '';
- var l = formatData.split('.')[0].split('').reverse();
- var r = formatData.split('.')[1];
- var t = '';
- for (i = 0; i < l.length; i++) {
- t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? ',' : '');
- }
- return t.split('').reverse().join('') + '.' + r;
- }
- function strlen(str) {
- var len = 0;
- for (var i = 0; i < str.length; i++) {
- var c = str.charCodeAt(i);
- //单字节加1
- if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
- len++;
- }
- else {
- len += 2;
- }
- }
- return len;
- }
- </script>
- }
|