Browse Source

admin 2月15号

guojing 5 years ago
parent
commit
eeb3295f75

+ 8 - 0
admin-ui/app/whepi/mock/menu.json

@@ -9,6 +9,14 @@
       "iconCls": "icon-blank fa fa-desktop",
       "state": "close",
       "children": []
+    },
+    {
+      "id": "ENT10001",
+      "text": "团购系统",
+      "href": "/app/whepi/tugou/tugou.js",
+      "iconCls": "icon-blank fa fa-align-justify",
+      "state": "close",
+      "children": []
     }
   ]
 }

+ 152 - 0
admin-ui/app/whepi/tugou/dialogTugou.js

@@ -0,0 +1,152 @@
+define(function (require) {
+  return function (context) {
+
+    var $dlg, $form;
+
+    function queryGrid1(data) {
+      console.log(data);
+    }
+
+    return {
+      xtype: 'dialog',
+      dialogId: 'dialogTugou',
+      title: context.isEdit ? '编辑团购信息' : '新增团购信息',
+      width: '100%',
+      height: '100%',
+      onOpen: function () {
+        $dlg = $(this);
+        if (context.isEdit) {
+          $.yvan.ajax({
+            loadingMask: false,
+            url: api(''),
+            type: 'GET',
+            data: {joId: context.joId},
+            success: function (data) {
+              $dlg.find('form');
+              $form.formSet(data.data);
+            }
+          });
+        }
+      },
+      center: {
+        items: {
+          width: '100%',
+          height: '100%',
+          autoSizeColumns: true,
+          xtype: 'formgroup',
+          onRender: function () {
+            $form = $(this);
+          },
+          items: [
+            [
+              {name: 'uptownId', xtype: 'hidden'},
+              {
+                xtype: 'yvselect',
+                name: 'uptownName',
+                multiple: true,
+                label: '小区',
+                data: [{id: '1', text: '在团'}, {id: '2', text: '发货'}, {id: '3', text: '完成'}, {
+                  id: '4',
+                  text: '取消'
+                }],
+                width: 900,
+                height: 35,
+                validType: 'isBlank',
+                onChange: function (data) {
+                  queryGrid1(data);
+                },
+              }],
+            [
+              {
+                name: 'tgTitle',
+                label: '组团标题',
+                required: true,
+                maxlength: 20,
+                width: 450,
+                height: 35, validType: 'isBlank'
+              },
+              {
+                name: 'tgSupplier', label: '供应商', maxlength: 20,
+                width: 450, height: 35,
+                required: true,
+              },
+              [{
+                name: 'tgGoods', label: '团购套餐',
+                required: true, width: 900, height: 35,
+                maxlength: 100,
+                height: '100px', multiline: true,
+              }],
+              {
+                name: 'tgPrice',
+                label: '单价',
+                maxlength: 4, validType: 'integer',
+                required: true, width: 450, height: 35,
+              },
+              {
+                name: 'tgMinNum',
+                label: '最小起订量',
+                maxlength: 4, validType: 'integer',
+                required: true, width: 450, height: 35,
+              },
+              [{
+                name: 'tgMaxNum',
+                label: '最大上限', required: true, validType: 'integer',
+                maxlength: 4, width: 450, height: 35,
+              },
+                {
+                  name: 'tgEndTime',
+                  label: '团购截止时间',
+                  xtype: 'datetimebox',
+                  required: true, width: 450, height: 35,
+                },],
+              [{
+                name: 'tgDeliverTime',
+                multiline: true,
+                xtype: 'datetimebox',
+                label: '预计送货时间',
+                required: true, width: 450, height: 35,
+              },
+                {
+                  name: 'tgPhoneNumber', validType: 'telNum',
+                  label: '联系电话', width: 450, height: 35,
+                  required: true, maxlength: 11,
+                }],
+              [{
+                name: 'remarks',
+                label: '备注',
+                width: 900,
+                height: '100px',
+                maxlength: 500,
+              }]]
+          ],
+        }
+      },
+      buttons: [
+        {
+          text: "保存", iconCls: "fa fa-save", onClick: function () {
+            if ($form.formGet().uptownName.trim() == '' || $form.formGet().uptownName.trim() == '') {
+              $.yvan.msg('全空格无法保存');
+              return;
+            }
+            alert($form.formGet().uptownName)
+            $.yvan.postForm($form, {
+              url: (context.isEdit ? api('/record/CustInfo/update') : api('/record/CustInfo/insert')),
+              success: function (data) {
+                if (data.data == 1) {
+                  $.yvan.msg('保存成功');
+                  $dlg.window('close');
+                } else {
+                  $.yvan.msg('保存失败');
+                }
+              }
+            });
+          }
+        }, {
+          text: "关闭", iconCls: "fa fa-times", onClick: function () {
+            $dlg.dialog('close');
+          }
+        }
+      ]
+    };
+  };
+});

+ 217 - 0
admin-ui/app/whepi/tugou/tugou.js

@@ -0,0 +1,217 @@
+define(function (require) {
+    return function (context) {
+
+      var $grid1, $form;
+
+
+      // 输入搜索文本后点击回车按钮查询列表
+      function enterQueryGrid1(e) {
+        if (e.keyCode === 13) {
+          var tmp = $(this).val();
+          $form.formSet({queryProperties: tmp});
+          queryGrid1();
+        }
+      }
+
+      // 检索条件查询
+      function queryGrid1() {
+        var queryUrl = '';// 自行替换此参数
+        var queryForm = $form.formGet();
+        queryForm.roleCode = App.currentRoleCode;
+        $grid1.reload({
+          mtype: 'GET',
+          url: api(queryUrl),
+          queryParams: queryForm
+        }, true);
+      }
+
+      // 搜索按钮
+      var queryToolbarTitle = '团购信息管理';// 自行替换此参数
+      var queryToolbar = {
+        xtype: 'toolbar', title: queryToolbarTitle, items: [
+          {
+            text: '查询', iconCls: 'fa fa-search', onClick: function () {
+              queryGrid1();
+            }
+          }, {
+            text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
+              $form.formClear();
+              queryGrid1();
+            }
+          }, {
+            text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
+              App.closeMe(this);
+            }
+          }
+        ]
+      };
+
+      // 搜索条件
+      var queryFormPrompt = '团购标题';// 自行替换此参数
+      var queryForm = {
+        onRender: function () {
+          $form = $(this);
+        },
+        xtype: 'form',
+        items: [[
+          {
+            xtype: 'textbox',
+            label: '检索条件',
+            name: 'queryProperties',
+            prompt: queryFormPrompt,
+            labelWidth: 'auto',
+            events: {keydown: enterQueryGrid1}, width: 350
+          },
+          {
+            xtype: 'yvselect',
+            name: 'uptownId',
+            label: '小区',
+            data: [{id: '1', text: '在团'}, {id: '2', text: '发货'}, {id: '3', text: '完成'}, {
+              id: '4',
+              text: '取消'
+            }],
+            multiple: true,
+            labelWidth: 'auto',
+            width: 350,
+            onChange: function (data) {
+              queryGrid1();
+            },
+          },
+          {
+            xtype: 'yvselect',
+            name: 'tgStatus',
+            label: '状态',//,2,3完成,4取消
+            data: [{id: '', text: '全部'}, {id: '1', text: '在团'}, {id: '2', text: '发货'}, {id: '3', text: '完成'}, {
+              id: '4',
+              text: '取消'
+            }],
+            labelWidth: 'auto',
+            width: 200,
+            onChange: function (data) {
+              queryGrid1();
+            },
+          }
+        ]]
+      };
+
+      var gridToolbarTitle = '团购信息列表';// 自行替换此参数
+      var gridToolbar = {
+        xtype: 'toolbar',
+        title: gridToolbarTitle,
+        items: [
+          {
+            text: '新增', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
+              $.yvan.showDialog(this,
+                require('/app/whepi/tugou/dialogTugou.js')({
+                  isEdit: false,
+                  confirm: function () {
+                    $grid1.reload();
+                  }
+                })
+              );
+            }
+          },
+          {
+            text: '取消', iconCls: 'fa fa-pencil-square-o', onClick: function () {
+              var row = $grid1.rowData();
+              if (!row) {
+                $.yvan.msg('请先选择一行数据');
+                return;
+              }
+              if (row.tgStatus != 1) {
+                $.yvan.msg('在团状态才能取消');
+                return;
+              }
+              $.yvan.confirm('是否' + "<span style='color: red; font-weight:bold;'>取消</span>" + '[' + (row.joName) + ']任务?', {
+                yes: function (index) {
+                  $.yvan.ajax({
+                    method: 'post',
+                    url: api(''),
+                    data: {
+                      jmId: row.jmId,
+                    },
+                    success: function (data) {
+                      $.yvan.msg('成功');
+                      $grid1.reload();
+                    }
+                  });
+                }
+              });
+            }
+          }
+        ]
+      };
+
+      return {
+        north: {
+          height: 88,
+          /* split: true,
+           border: false,*///底框是否可变动
+          items: [
+            queryToolbar,
+            queryForm
+          ]
+        },
+        center: {
+          height: '60%',
+          split: true,
+          items:
+            {
+              onRender: function () {
+                $grid1 = $(this);
+                queryGrid1()
+              },
+              xtype: 'grid',
+              toolbar:
+              gridToolbar,
+              idField: 'joId',
+              autoSizeColumns: true,//序号多  正确显示
+              columns:
+                [
+                  [
+                    {field: 'jmId', title: '信息id', hidden: true},
+                    {field: 'uptown_id', title: '小区id', maxWidth: 200, align: 'left', hidden: true},
+                    {field: 'uptownName', title: '小区', maxWidth: 200, align: 'left',},
+                    {field: 'tgTitle', title: '组团标题', maxWidth: 200, align: 'left',},
+                    {field: 'tgSupplier', title: '供应商', maxWidth: 200,},
+                    {
+                      field: 'tgGoods',
+                      title: '团购套餐', maxWidth: 200,
+                    },
+                    {
+                      field: 'tgPrice',
+                      title: '单价',
+                    },
+                    {
+                      field: 'tgMinNum',
+                      title: '最小起订量',
+                      align: 'left',
+                    },
+                    {
+                      field: 'tgMaxNum',
+                      title: '最大上限',
+                      align: 'left',
+                    },
+                    {
+                      field: 'tgEndTime',
+                      title: '团购截止时间',
+                      align: 'center',
+                    },
+                    {
+                      field: 'tgDeliverTime', title: '预计送货时间', align: 'center',
+                    },
+
+                    {field: 'tgPhoneNumber', title: '联系电话', align: 'center'},
+                    {field: 'remark', title: '备注', maxWidth: 200, align: 'left'},
+                    {
+                      field: 'tgStatus', title: '状态',
+                      align: 'center',
+                    },
+                  ]
+                ]
+            }
+        }
+      };
+    };
+  }
+);

+ 2 - 2
whepi-ui/templates/home/buy.ftl

@@ -103,7 +103,7 @@
             $('#buyAll').append(' <a href="javascript:void(0);" style="color: grey;font-size: large" data-id="form"\n' +
                     '                                             onclick=\'myBuyClick(' + JSON.stringify(v) + ')\'>\n' +
                     '                <div style="display: flex; flex-direction: row; text-align: center; font-size: x-small; line-height: 4vh;">\n' +
-                    '                    <div style="width: 30%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px;text-align: left;text-indent:25%;">' + v.tgTitle + '</div>\n' +
+                    '                    <div style="width: 30%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px;text-align: left;">' + v.tgTitle + '</div>\n' +
                     '                    <div style="width: 20%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">\n' + v.count + '/' + v.tgMinNum + '</div>\n' +
                     '                    <div style="width: 35%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">' + sub(v.tgEndTime) + '</div>\n' +
                     '                    <div style="width: 15%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">' + getStatus(v.tgStatus) + '</div>\n' +
@@ -143,7 +143,7 @@
         function MybuyList(v) {
             $('#MyBuyAll').append('<a href="javascript:void(0);" style="color: grey;font-size: large" data-id="form" onclick=\'myBuyClick2(' + JSON.stringify(v) + ')\'>\n' +
                     '                        <div style="display: flex; flex-direction: row; text-align: center; font-size: x-small; line-height: 4vh;">\n' +
-                    '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px;text-align: left;text-indent:21%;">' + v.tgTitle + '</div>\n' +
+                    '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px;text-align: left;">' + v.tgTitle + '</div>\n' +
                     '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">' + timestampY(v.timeCreate) + '</div>\n' +
                     '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">' + getStatus(v.tgStatus) + '</div>\n' +
                     '                        </div>\n' + '                    </a>')

+ 4 - 4
whepi-web/src/main/java/com/bofeng/wx/controller/UserOpenController.java

@@ -64,10 +64,10 @@ public class UserOpenController {
                              @RequestParam(value = "userType", required = false, defaultValue = "0") Integer userType) throws JsonProcessingException {
         List<UserRole> list = new ArrayList<>();
         if (userId == 0) {
-            UserOpen userOpen = homeService.getUserOpen();
-            list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
-//            list = userRoleMapper.getUserRoleByUserId(1225321682867105793L);
-//            UserOpen userOpen = userOpenMapper.selectByUserId(1225321682867105793L);
+           // UserOpen userOpen = homeService.getUserOpen();
+           // list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
+           list = userRoleMapper.getUserRoleByUserId(1225321682867105793L);
+            UserOpen userOpen = userOpenMapper.selectByUserId(1225321682867105793L);
             userId = userOpen.getUserId();
             model.put("user", userOpen);
             model.put("user_id", "\"" + userOpen.getUserId() + "\"");