|
@@ -36,7 +36,7 @@ define(function (require) {
|
|
return {
|
|
return {
|
|
xtype: 'dialog',
|
|
xtype: 'dialog',
|
|
dialogId: 'dialogTugou',
|
|
dialogId: 'dialogTugou',
|
|
- title: context.isEdit == 2 ? '增补修订需求' : '新增需求发布',
|
|
|
|
|
|
+ title: context.isEdit == 2 ? '增补修订需求' : (context.isEdit == 3 ? '取消需求' : '新增需求发布'),
|
|
width: '100%',
|
|
width: '100%',
|
|
height: '100%',
|
|
height: '100%',
|
|
onOpen: function () {
|
|
onOpen: function () {
|
|
@@ -78,7 +78,7 @@ define(function (require) {
|
|
width: 900,
|
|
width: 900,
|
|
height: 35,
|
|
height: 35,
|
|
validType: 'isBlank',
|
|
validType: 'isBlank',
|
|
- readonly: context.isEdit != 1 ? true : false,
|
|
|
|
|
|
+ disabled: context.isEdit != 1 ? true : false,
|
|
onChange: function (data) {
|
|
onChange: function (data) {
|
|
queryGrid1(data);
|
|
queryGrid1(data);
|
|
},
|
|
},
|
|
@@ -93,7 +93,7 @@ define(function (require) {
|
|
}, {id: '5', text: '其他服务'}],
|
|
}, {id: '5', text: '其他服务'}],
|
|
width: 450,
|
|
width: 450,
|
|
height: 35,
|
|
height: 35,
|
|
- readonly: context.isEdit != 1 ? true : false,
|
|
|
|
|
|
+ disabled: context.isEdit != 1 ? true : false,
|
|
required: true,
|
|
required: true,
|
|
onChange: function (data) {
|
|
onChange: function (data) {
|
|
|
|
|
|
@@ -101,14 +101,14 @@ define(function (require) {
|
|
}, {
|
|
}, {
|
|
name: 'tgPrice',
|
|
name: 'tgPrice',
|
|
label: '单价',
|
|
label: '单价',
|
|
- readonly: context.isEdit != 1 ? true : false,
|
|
|
|
|
|
+ disabled: context.isEdit != 1 ? true : false,
|
|
maxlength: 6, validType: 'number',
|
|
maxlength: 6, validType: 'number',
|
|
width: 450, height: 35,
|
|
width: 450, height: 35,
|
|
}],
|
|
}],
|
|
[{
|
|
[{
|
|
name: 'tgItemNum',
|
|
name: 'tgItemNum',
|
|
- label: '单人限额',
|
|
|
|
- readonly: context.isEdit != 1 ? true : false,
|
|
|
|
|
|
+ label: '个人限额',
|
|
|
|
+ disabled: context.isEdit != 1 ? true : false,
|
|
maxlength: 6, validType: 'integer',
|
|
maxlength: 6, validType: 'integer',
|
|
width: 450, height: 35,
|
|
width: 450, height: 35,
|
|
},],
|
|
},],
|
|
@@ -116,31 +116,31 @@ define(function (require) {
|
|
name: 'tgGoods', label: '套餐描述',
|
|
name: 'tgGoods', label: '套餐描述',
|
|
required: true, width: 900, height: 35,
|
|
required: true, width: 900, height: 35,
|
|
maxlength: 500,
|
|
maxlength: 500,
|
|
- readonly: context.isEdit != 1 ? true : false,
|
|
|
|
|
|
+ disabled: context.isEdit != 1 ? true : false,
|
|
height: '100px', multiline: true,
|
|
height: '100px', multiline: true,
|
|
}],
|
|
}],
|
|
[{
|
|
[{
|
|
name: 'tgMinNum',
|
|
name: 'tgMinNum',
|
|
label: '最低配送',
|
|
label: '最低配送',
|
|
- readonly: context.isEdit != 1 ? true : false,
|
|
|
|
|
|
+ disabled: context.isEdit != 1 ? true : false,
|
|
maxlength: 4, validType: 'integer',
|
|
maxlength: 4, validType: 'integer',
|
|
width: 450, height: 35,
|
|
width: 450, height: 35,
|
|
}, {
|
|
}, {
|
|
name: 'tgMaxNum',
|
|
name: 'tgMaxNum',
|
|
- readonly: context.isEdit != 1 ? true : false,
|
|
|
|
|
|
+ disabled: context.isEdit != 1 ? true : false,
|
|
label: '配送上限', validType: 'integer',
|
|
label: '配送上限', validType: 'integer',
|
|
maxlength: 4, width: 450, height: 35,
|
|
maxlength: 4, width: 450, height: 35,
|
|
}],
|
|
}],
|
|
[{
|
|
[{
|
|
name: 'tgEndTime',
|
|
name: 'tgEndTime',
|
|
label: '需求截止时间',
|
|
label: '需求截止时间',
|
|
- readonly: context.isEdit != 1 ? true : false,
|
|
|
|
|
|
+ disabled: context.isEdit == 3 ? true : false,
|
|
xtype: 'datetimebox',
|
|
xtype: 'datetimebox',
|
|
required: true, width: 450, height: 35,
|
|
required: true, width: 450, height: 35,
|
|
}, {
|
|
}, {
|
|
name: 'tgDeliverTime',
|
|
name: 'tgDeliverTime',
|
|
multiline: true,
|
|
multiline: true,
|
|
- readonly: context.isEdit != 1 ? true : false,
|
|
|
|
|
|
+ disabled: context.isEdit == 3 ? true : false,
|
|
xtype: 'datetimebox',
|
|
xtype: 'datetimebox',
|
|
label: '预计配货时间',
|
|
label: '预计配货时间',
|
|
required: true, width: 450, height: 35,
|
|
required: true, width: 450, height: 35,
|
|
@@ -148,19 +148,19 @@ define(function (require) {
|
|
{
|
|
{
|
|
name: 'tgPhoneNumber', validType: 'telNum',
|
|
name: 'tgPhoneNumber', validType: 'telNum',
|
|
label: '联系电话', width: 450, height: 35,
|
|
label: '联系电话', width: 450, height: 35,
|
|
- readonly: context.isEdit != 1 ? true : false,
|
|
|
|
|
|
+ disabled: context.isEdit != 1 ? true : false,
|
|
required: true, maxlength: 11,
|
|
required: true, maxlength: 11,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: 'tgSupplier', width: 450, height: 35,
|
|
name: 'tgSupplier', width: 450, height: 35,
|
|
- label: '供应商', maxlength: 20,
|
|
|
|
- readonly: context.isEdit != 1 ? true : false,
|
|
|
|
|
|
+ label: '供应商', maxlength: 20, required: true,
|
|
|
|
+ disabled: context.isEdit != 1 ? true : false,
|
|
}],
|
|
}],
|
|
[
|
|
[
|
|
{
|
|
{
|
|
name: 'remark', width: 900, height: 120,
|
|
name: 'remark', width: 900, height: 120,
|
|
label: '备注', maxlength: 500, multiline: true,
|
|
label: '备注', maxlength: 500, multiline: true,
|
|
- required: true, xtype: context.isEdit==1 ? 'hidden' : '',
|
|
|
|
|
|
+ required: true, xtype: context.isEdit == 1 ? 'hidden' : '',
|
|
}
|
|
}
|
|
]
|
|
]
|
|
],
|
|
],
|
|
@@ -173,21 +173,29 @@ define(function (require) {
|
|
$.yvan.msg('请先选择小区');
|
|
$.yvan.msg('请先选择小区');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- if ($form.formGet().tgMinNum > $form.formGet().tgMaxNum) {
|
|
|
|
- $.yvan.msg('最大上限必须大于等于最小起订量');
|
|
|
|
- return;
|
|
|
|
|
|
+ if ($form.formGet().tgMinNum != '') {
|
|
|
|
+ if ($form.formGet().tgMaxNum != '') {
|
|
|
|
+ if ($form.formGet().tgMinNum > $form.formGet().tgMaxNum) {
|
|
|
|
+ $.yvan.msg('最大上限必须大于等于最小起订量');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
if ($form.formGet().tgEndTime > $form.formGet().tgDeliverTime) {
|
|
if ($form.formGet().tgEndTime > $form.formGet().tgDeliverTime) {
|
|
$.yvan.msg('团购截止时间必须小于预计送货时间');
|
|
$.yvan.msg('团购截止时间必须小于预计送货时间');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
console.log($form.formGet());
|
|
console.log($form.formGet());
|
|
- if (isLoading === true) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- isLoading = true;
|
|
|
|
|
|
+ if (context.isEdit == 1) {
|
|
|
|
+ if (isLoading === true) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ isLoading = true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
$.yvan.postForm($form, {
|
|
$.yvan.postForm($form, {
|
|
url: (context.isEdit == 1 ? api('/yeweihui/tgPublish') : (context.isEdit == 3 ? api('/yeweihui/updateStatus') : api('/yeweihui/tgStatus'))),
|
|
url: (context.isEdit == 1 ? api('/yeweihui/tgPublish') : (context.isEdit == 3 ? api('/yeweihui/updateStatus') : api('/yeweihui/tgStatus'))),
|
|
success: function (data) {
|
|
success: function (data) {
|