From a4a8313eca6123f595499b2069c18edec20ea0ef Mon Sep 17 00:00:00 2001
From: 王佳豪 <g675230687@126.com>
Date: 星期二, 16 三月 2021 10:33:37 +0800
Subject: [PATCH] 1.0.3 销售订单Demo界面
---
src/main/webapp/views/salesOrder/salesOrder.html | 93 +++++++++++++++++++++++
src/main/webapp/static/js/salesOrder/salsesOrder.js | 130 ++++++++++++++++++++++++++++++++
2 files changed, 223 insertions(+), 0 deletions(-)
diff --git a/src/main/webapp/static/js/salesOrder/salsesOrder.js b/src/main/webapp/static/js/salesOrder/salsesOrder.js
new file mode 100644
index 0000000..ffa4cfd
--- /dev/null
+++ b/src/main/webapp/static/js/salesOrder/salsesOrder.js
@@ -0,0 +1,130 @@
+var pageCurr;
+
+function getCol() {
+ var cols = [];
+ cols.push(
+ {field: 'orderNo', align: 'center', title: '璁㈠崟缂栧彿'}
+ , {field: 'col1', align: 'center', title: '璁㈠崟鍚嶇О'}
+ , {field: 'col2', align: 'center', title: '璁㈠崟璇︽儏'}
+ , {field: 'col3', align: 'center', title: '璁㈠崟瀹㈡埛'}
+ , {field: 'col4', align: 'center', title: '璁㈠崟鐘舵��'}
+ , {fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width: 80}
+ );
+ return cols;
+}
+
+layui.use(['table', 'laydate', 'form', 'upload'], function () {
+ var table = layui.table;
+ var $ = layui.jquery;
+ var layer = layui.layer;
+ var layDate = layui.laydate;
+ var form = layui.form;
+ var upload = layui.upload;
+
+ // 鏁版嵁娓叉煋
+ tableIns = table.render({
+ elem: '#salesOrder',
+ headers: {token: localStorage.getItem('token')},
+ // url: baseUrl+'/matCode/list/auth',
+ data: [
+ {
+ "orderNo": 20210315000001,
+ "col1": "瑗跨彮鐗檟x 210315鍙�",
+ "col2": "鍏板崥鍩哄凹绔ヨ溅 5000鍙�",
+ "col3": "瑗跨彮鐗檟x鍎跨鐜╁叿鍏徃",
+ "col4": "鐢熶骇涓�",
+ }
+ ],
+ page: true,
+ limit: 16,
+ limits: [16, 50, 100, 200, 500],
+ even: true,
+ toolbar: '#toolbar',
+ cellMinWidth: 50,
+ cols: [getCol()],
+ request: {
+ pageName: 'curr',
+ pageSize: 'limit'
+ },
+ parseData: function (res) {
+ return {
+ 'code': res.code,
+ 'msg': res.msg,
+ 'count': res.data.total,
+ 'data': res.data.records
+ }
+ },
+ response: {
+ statusCode: 200
+ },
+ done: function(res, curr, count) {
+ if (res.code === 403) {
+ top.location.href = baseUrl+"/";
+ }
+ pageCurr=curr;
+ }
+ });
+
+ // 鎼滅储鏍忛噸缃簨浠�
+ form.on('submit(reset)', function (data) {
+ pageCurr = 1;
+ clearFormVal($('#search-box'));
+ tableReload(false);
+ });
+
+ // 鎼滅储鏍忔悳绱簨浠�
+ form.on('submit(search)', function (data) {
+ pageCurr = 1;
+ tableReload(false);
+ });
+
+
+ // 鏃堕棿閫夋嫨鍣�
+ layDate.render({
+ elem: '.layui-laydate-range'
+ , type: 'datetime'
+ , range: true
+ });
+});
+
+/* 琛ㄦ牸鏁版嵁閲嶈浇 */
+function tableReload(child) {
+ var searchData = {};
+ $.each($('#search-box [name]').serializeArray(), function () {
+ searchData[this.name] = this.value;
+ });
+
+ console.log('鎼滅储鍐呭', searchData);
+
+ // (child ? parent.tableIns : tableIns).reload({
+ // where: searchData,
+ // page: {
+ // curr: pageCurr
+ // },
+ // done: function (res, curr, count) {
+ // if (res.code === 403) {
+ // top.location.href = baseUrl + "/";
+ // }
+ // pageCurr = curr;
+ // if (res.data.length === 0 && count !== 0) {
+ // tableIns.reload({
+ // where: searchData,
+ // page: {
+ // curr: pageCurr - 1
+ // }
+ // });
+ // pageCurr -= 1;
+ // }
+ // limit(child);
+ // // 褰撳墠鍒嗛〉鏁版嵁瀛樺偍
+ // locNormalList = res.data;
+ // }
+ // });
+}
+
+/* 鐩戝惉鍥炶溅浜嬩欢 */
+$('body').keydown(function () {
+ if (event.keyCode === 13) {
+ $("#search").click();
+ }
+});
diff --git a/src/main/webapp/views/salesOrder/salesOrder.html b/src/main/webapp/views/salesOrder/salesOrder.html
new file mode 100644
index 0000000..3a6d8c4
--- /dev/null
+++ b/src/main/webapp/views/salesOrder/salesOrder.html
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title></title>
+ <meta name="renderer" content="webkit">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+ <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
+ <link rel="stylesheet" href="../../static/css/cool.css" media="all">
+ <link rel="stylesheet" href="../../static/css/common.css" media="all">
+ <link rel="stylesheet" href="../../static/css/print.css" media="all">
+</head>
+<style>
+ #search-box {
+ padding: 30px 30px 10px 30px;
+ }
+
+ #search-box .layui-inline {
+ margin-right: 5px;
+ }
+
+ #data-search-btn {
+ margin-top: 10px;
+ }
+
+ #data-search-btn.layui-btn-container .layui-btn {
+ margin-right: 20px;
+ }
+
+ .contain td {
+ border: 1px solid #000;
+ /*line-height: 46px;*/
+ }
+
+</style>
+<body>
+
+<div>
+ <!-- 鎼滅储鏍� -->
+ <div id="search-box" class="layui-form layui-card-header">
+ <div class="layui-inline">
+ <div class="layui-input-inline">
+ <input class="layui-input" type="text" name="orderNo" placeholder="璁㈠崟鍙�" autocomplete="off">
+ </div>
+ </div>
+
+ <!-- 鏃ユ湡鑼冨洿 -->
+ <div class="layui-inline" style="width: 300px">
+ <div class="layui-input-inline">
+ <input class="layui-input layui-laydate-range" name="orderTime" type="text" placeholder="璧峰鏃堕棿 - 缁堟鏃堕棿" autocomplete="off" style="width: 300px">
+ </div>
+ </div>
+
+ <div class="layui-inline" style="width: 150px">
+ <select id="orderState" name="orderState">
+ <option value="">璁㈠崟鐘舵��</option>
+ <option value="1">鍒濆</option>
+ <option value="2">鎵ц涓�</option>
+ <option value="3">缁撴潫</option>
+ </select>
+ </div>
+
+
+ <div id="data-search-btn" class="layui-btn-container layui-form-item">
+ <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">鎼滅储
+ </button>
+ <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">閲嶇疆
+ </button>
+ </div>
+ </div>
+
+ <!-- 琛ㄦ牸 -->
+ <div class="layui-form">
+ <table class="layui-hide" id="salesOrder" lay-filter="salesOrder"></table>
+ </div>
+
+</div>
+
+<script type="text/html" id="operate">
+ <button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="btnPrint">璐ㄦ</button>
+</script>
+
+<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
+<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script>
+<script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/salesOrder/salsesOrder.js"></script>
+
+</body>
+</html>
+
--
Gitblit v1.9.1