|
@@ -33,7 +33,7 @@ define(function (require) {
|
|
|
return {
|
|
|
xtype: 'dialog',
|
|
|
dialogId: 'dialogTugou',
|
|
|
- title: context.isEdit ? '编辑团购信息' : '新增团购信息',
|
|
|
+ title: context.isEdit ? '取消团购信息' : '新增团购信息',
|
|
|
width: '100%',
|
|
|
height: '100%',
|
|
|
onOpen: function () {
|
|
@@ -41,9 +41,9 @@ define(function (require) {
|
|
|
if (context.isEdit) {
|
|
|
$.yvan.ajax({
|
|
|
loadingMask: false,
|
|
|
- url: api(''),
|
|
|
- type: 'GET',
|
|
|
- data: {joId: context.joId},
|
|
|
+ url: api('/getSelectOne'),
|
|
|
+ type: 'POST',
|
|
|
+ data: {jmId: context.jmId},
|
|
|
success: function (data) {
|
|
|
$dlg.find('form');
|
|
|
$form.formSet(data.data);
|
|
@@ -61,7 +61,11 @@ define(function (require) {
|
|
|
$form = $(this);
|
|
|
},
|
|
|
items: [
|
|
|
- [
|
|
|
+ [{
|
|
|
+ name: 'jmId',
|
|
|
+ label: '组团id',
|
|
|
+ xtype: 'hidden',
|
|
|
+ },
|
|
|
{
|
|
|
xtype: 'yvselect',
|
|
|
name: 'uptownIds',
|
|
@@ -71,6 +75,7 @@ define(function (require) {
|
|
|
width: 900,
|
|
|
height: 35,
|
|
|
validType: 'isBlank',
|
|
|
+ readonly: context.isEdit ? true : false,
|
|
|
onChange: function (data) {
|
|
|
queryGrid1(data);
|
|
|
},
|
|
@@ -81,6 +86,7 @@ define(function (require) {
|
|
|
label: '组团标题',
|
|
|
required: true,
|
|
|
maxlength: 20,
|
|
|
+ readonly: context.isEdit ? true : false,
|
|
|
width: 450,
|
|
|
height: 35, validType: 'isBlank'
|
|
|
},
|
|
@@ -88,39 +94,46 @@ define(function (require) {
|
|
|
name: 'tgSupplier', label: '供应商', maxlength: 20,
|
|
|
width: 450, height: 35,
|
|
|
required: true,
|
|
|
+ readonly: context.isEdit ? true : false,
|
|
|
},
|
|
|
[{
|
|
|
name: 'tgGoods', label: '团购套餐',
|
|
|
required: true, width: 900, height: 35,
|
|
|
- maxlength: 100,
|
|
|
+ maxlength: 50,
|
|
|
+ readonly: context.isEdit ? true : false,
|
|
|
height: '100px', multiline: true,
|
|
|
}],
|
|
|
{
|
|
|
name: 'tgPrice',
|
|
|
label: '单价',
|
|
|
+ readonly: context.isEdit ? true : false,
|
|
|
maxlength: 4, validType: 'integer',
|
|
|
required: true, width: 450, height: 35,
|
|
|
},
|
|
|
{
|
|
|
name: 'tgMinNum',
|
|
|
label: '最小起订量',
|
|
|
+ readonly: context.isEdit ? true : false,
|
|
|
maxlength: 4, validType: 'integer',
|
|
|
required: true, width: 450, height: 35,
|
|
|
},
|
|
|
[{
|
|
|
name: 'tgMaxNum',
|
|
|
+ readonly: context.isEdit ? true : false,
|
|
|
label: '最大上限', required: true, validType: 'integer',
|
|
|
maxlength: 4, width: 450, height: 35,
|
|
|
},
|
|
|
{
|
|
|
name: 'tgEndTime',
|
|
|
label: '团购截止时间',
|
|
|
+ readonly: context.isEdit ? true : false,
|
|
|
xtype: 'datetimebox',
|
|
|
required: true, width: 450, height: 35,
|
|
|
},],
|
|
|
[{
|
|
|
name: 'tgDeliverTime',
|
|
|
multiline: true,
|
|
|
+ readonly: context.isEdit ? true : false,
|
|
|
xtype: 'datetimebox',
|
|
|
label: '预计送货时间',
|
|
|
required: true, width: 450, height: 35,
|
|
@@ -128,15 +141,16 @@ define(function (require) {
|
|
|
{
|
|
|
name: 'tgPhoneNumber', validType: 'telNum',
|
|
|
label: '联系电话', width: 450, height: 35,
|
|
|
+ readonly: context.isEdit ? true : false,
|
|
|
required: true, maxlength: 11,
|
|
|
}],
|
|
|
[{
|
|
|
- name: 'remarks',
|
|
|
+ name: 'remark',
|
|
|
label: '备注',
|
|
|
multiline: true,
|
|
|
width: 900,
|
|
|
height: '100px',
|
|
|
- maxlength: 500,
|
|
|
+ maxlength: 100,
|
|
|
}]]
|
|
|
],
|
|
|
}
|
|
@@ -148,13 +162,25 @@ define(function (require) {
|
|
|
$.yvan.msg('请先选择小区');
|
|
|
return;
|
|
|
}
|
|
|
+ if ($form.formGet().tgMinNum > $form.formGet().tgMaxNum) {
|
|
|
+ $.yvan.msg('最大上线必须大于等于最小起订量');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if ($form.formGet().tgEndTime > $form.formGet().tgDeliverTime) {
|
|
|
+ $.yvan.msg('团购截止时间必须小于预计送货时间');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
console.log($form.formGet())
|
|
|
$.yvan.postForm($form, {
|
|
|
- url: (context.isEdit ? api('/record/CustInfo/update') : api('/yeweihui/tgPublish')),
|
|
|
+ url: (context.isEdit ? api('/yeweihui/tgStatus') : api('/yeweihui/tgPublish')),
|
|
|
success: function (data) {
|
|
|
if (data.data == 1) {
|
|
|
$.yvan.msg('保存成功');
|
|
|
$dlg.window('close');
|
|
|
+ if ($.type(context.confirm) === 'function') {
|
|
|
+ context.confirm();
|
|
|
+ }
|
|
|
} else {
|
|
|
$.yvan.msg('保存失败');
|
|
|
}
|