浏览代码

凌云集团更改公司

peiguo 5 年之前
父节点
当前提交
2abb16cf78
共有 3 个文件被更改,包括 67 次插入14 次删除
  1. 44 12
      admin-ui/app/whepi/scan/xqmanage.js
  2. 15 0
      admin-ui/format.js
  3. 8 2
      whepi-web/src/main/resources/mapper/SweepCodeMapper.xml

+ 44 - 12
admin-ui/app/whepi/scan/xqmanage.js

@@ -3,18 +3,25 @@ define(function (require) {
 
             var $grid1, $form;
 
+            // 弹框的方式
+            var widgets = {
+                // 搜索分类检索
+                selectTable: {
+                    url: 'app/whepi/home/selectUptown.js',
+                    bind: {
+                        uptownId: 'uptownId',
+                        uptownName: 'uptownName',
+                    },
+                },
+            }
+
 
             // 导出
             function exportExcel() {
-                var row = $grid1.rowData();
-                if (!row) {
-                    $.yvan.msg('请先选择一行数据');
-                    return;
-                }
                 var queryForm = $form.formGet();
                 $.yvan.download({
                     method: 'post',
-                    url: api('/sweepCode/export?queryProperties=' + queryForm.queryProperties + '&goStatus=' + queryForm.goStatus + '&dateSta=' + queryForm.dateSta + '&dateEnd=' + queryForm.dateEnd),
+                    url: api('/sweepCode/export?queryProperties=' + queryForm.queryProperties + '&uptownId=' + queryForm.uptownId + '&goStatus=' + queryForm.goStatus + '&dateSta=' + queryForm.dateSta + '&dateEnd=' + queryForm.dateEnd),
                     fileName: '进出管理-' + $.yvan.getMoment().format('YYYY-MM-DD HH:mm:ss') + '.xlsx'
 
                 });
@@ -33,6 +40,14 @@ define(function (require) {
             function queryGrid1() {
                 var queryUrl = '/sweepCode/selectCode';// 自行替换此参数
                 var queryForm = $form.formGet();
+                if (!queryForm.dateSta) {
+                    $form.formSet({dateSta: getFormatDate() + " 00:00:00"});
+                    queryForm.dateSta = getFormatDate() + " 00:00:00";
+                }
+                if (!queryForm.dateEnd) {
+                    $form.formSet({dateEnd: getFormatDate() + " 23:59:59"});
+                    queryForm.dateEnd = getFormatDate() + " 23:59:59";
+                }
                 queryForm.roleCode = App.currentRoleCode;
                 $grid1.reload({
                     mtype: 'POST',
@@ -63,7 +78,6 @@ define(function (require) {
             };
 
             // 搜索条件
-            var queryFormPrompt = '名称';// 自行替换此参数
             var queryForm = {
                 onRender: function () {
                     $form = $(this);
@@ -72,11 +86,29 @@ define(function (require) {
                 items: [[
                     {
                         xtype: 'textbox',
-                        label: '小区名称',
+                        label: '大门名称',
                         name: 'queryProperties',
-                        prompt: queryFormPrompt,
+                        prompt: "大门名称",
                         labelWidth: 'auto',
-                        events: {keydown: enterQueryGrid1}, width: 350
+                        events: {keydown: enterQueryGrid1}, width: 250
+                    },
+                    {xtype: 'hidden', name: 'uptownId'},
+                    {
+                        xtype: 'searchbox',
+                        label: '小区',
+                        name: 'uptownName',
+                        prompt: "小区",
+                        width: '300px',
+                        widget: widgets.selectTable,// 弹出框方法
+                        labelWidth: '70px',
+                        onChange: function (value) {
+                            if (!isNotNullOrEmpty(value)) {
+                                $form.formSet({
+                                    uptownId: ''
+                                })
+                            }
+                            queryGrid1();
+                        },
                     },
                     {
                         xtype: 'yvselect', label: '通行状态', name: 'goStatus', labelWidth: 'auto', value: '', width: 220,
@@ -89,7 +121,7 @@ define(function (require) {
                         }
                     },
                     {
-                        xtype: 'datebox',
+                        xtype: 'datetimebox',
                         name: 'dateSta',
                         label: '进出时间',
                         labelWidth: 'auto',
@@ -106,7 +138,7 @@ define(function (require) {
                         }
                     },
                     {
-                        xtype: 'datebox', label: '--', name: 'dateEnd', labelWidth: 'auto', width: 180,
+                        xtype: 'datetimebox', label: '--', name: 'dateEnd', labelWidth: 'auto', width: 220,
                         onChange: function (data) {
                            /* var expDateStart = $form.formGet().nextRepairDate;
                             var expDateEnd = $form.formGet().expDateEnd;

+ 15 - 0
admin-ui/format.js

@@ -2595,4 +2595,19 @@ var filterHTMLTag = function (msg) {
   msg = msg.replace(/[|]*\n/, '') //去除行尾空格
   msg = msg.replace(/&npsp;/ig, ''); //去掉npsp
   return msg;
+}
+// 获取当前时间并格式化YY-MM-DD
+function getFormatDate() {
+  var date = new Date();
+  var year = date.getFullYear();
+  var month = date.getMonth() + 1;
+  var nowDate = date.getDate();
+  if(month >=1 && month <=9) {
+    month = "0" + month;
+  }
+  if(nowDate >=0 && nowDate <=9) {
+    nowDate = "0" + nowDate;
+  }
+  var newDate = year + "-" + month + "-" + nowDate;
+  return newDate;
 }

+ 8 - 2
whepi-web/src/main/resources/mapper/SweepCodeMapper.xml

@@ -24,7 +24,10 @@
      inner join sys_uptown_unit d on d.unit_id = e.unit_id
         <where>
          <if test="queryProperties != null and queryProperties != ''">
-          a.uptown_name like concat('%',#{queryProperties},'%')
+          b.door_name like concat('%',#{queryProperties},'%')
+         </if>
+         <if test="uptownId != null and uptownId != ''">
+          and a.uptown_id = #{uptownId}
          </if>
          <if test="goStatus != null and goStatus !=''">
           and c.go_status = #{goStatus}
@@ -87,7 +90,10 @@
      inner join sys_uptown_unit d on d.unit_id = e.unit_id
         <where>
          <if test="queryProperties != null and queryProperties != ''">
-          a.uptown_name like concat('%',#{queryProperties},'%')
+          b.door_name like concat('%',#{queryProperties},'%')
+         </if>
+         <if test="uptownId != null and uptownId != ''">
+          and a.uptown_id = #{uptownId}
          </if>
          <if test="goStatus != null and goStatus !=''">
           and c.go_status = #{goStatus}