|
@@ -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',
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ };
|
|
|
+ }
|
|
|
+);
|