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