123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- define(function (require) {
- return function () {
- var group1 = require('/yvanui/example/group1.js');
- var group2 = {
- xtype: 'group',
- title: '分组框',
- items: [[
- {label: '输入框1'},
- {label: '输入框2'},
- {label: '输入框3'},
- ]]
- };
- var $form1;
- return {
- center: {
- border: false,
- title: '简单表单',
- items: [
- {
- onRender: function () {
- $form1 = $(this);
- },
- xtype: 'formgroup',
- title: '表单1',
- items: [
- [
- {name: 'whCode', xtype: 'numberbox', label: '仓库编号', maxlength: 5},
- {name: 'whName', label: '仓库名称', maxlength: 5}
- ], [
- {
- xtype: 'numberbox',
- name: 'planPrice',
- label: '计划价(¥)',
- // validType: 'gtZeroCon',
- prompt: '填写数字',
- labelWidth: 120,
- required: true,
- maxlength: 9,
- min: 0,
- precision: 2,
- }
- ], [
- {xtype: 'datebox', name: 'createAt', label: '新增日期', required: true},
- {xtype: 'datetimebox', name: 'createAtTime', label: '新增时间', required: true},
- ], [
- {
- xtype: 'yvselect', name: 'beActive', label: '是否活动', required: true, data: [
- {id: 'Y', text: '是'},
- {id: 'N', text: '否'}
- ], onChange: function (v) {
- $.yvan.msg(v);
- }
- },
- //{ xtype: 'yvselect', name: 'packingType', label: '系统标准', required: true, data: $.yvan.bizDict('packingType').combo() },
- {
- xtype: 'yvselect', name: 'packingType', label: '系统标准', required: true, data: [
- {id: '0', text: '未配置'},
- {id: '1', text: '现款'},
- {id: '2', text: '款到发货'},
- {id: '3', text: '货到收款'},
- {id: '4', text: '货款在途'},
- {id: '5', text: '协议欠款'},
- {id: '6', text: '货款已付'},
- {id: '7', text: '电汇'},
- {id: '9', text: '销售抵款'},
- {id: '10', text: '货到付支'},
- {id: '11', text: '货到付电'},
- {id: '15', text: '限期欠款'},
- {id: '16', text: '临时欠款'},
- {id: '17', text: '代收货款'}
- ],
- onChange: function () {
- console.log('yvselect onchange', this, arguments);
- }
- },
- {name: 'whareaCode', label: '库区编号', xtype: 'textbox', required: true},
- {name: 'whareaName', label: '库区名称', xtype: 'searchbox', required: true},
- {xtype: 'hidden', name: 'whareaID'}
- ], [
- {xtype: 'offset'},
- {xtype: 'checkbox', label: '多选1', name: 'checkA11', value: 99},
- {xtype: 'checkbox', label: '多选2', name: 'checkA12', value: 99, checked: true},
- {xtype: 'checkbox', label: '多选3', name: 'checkA13', value: 99},
- {xtype: 'checkbox', label: '多选4-禁用', name: 'checkA14', value: 99, disabled: true},
- ], [
- {xtype: 'offset'},
- {xtype: 'checkbox', label: '多选1', name: 'checkA21', value: 99},
- {xtype: 'checkbox', label: '多选2', name: 'checkA22', value: 99},
- {xtype: 'checkbox', label: '多选3', name: 'checkA23', value: 99, checked: true},
- {xtype: 'checkbox', label: '多选4-禁用', name: 'checkA24', value: 99, disabled: true},
- ], [
- {xtype: 'offset'},
- {xtype: 'radiobutton', label: '单选1-禁用', name: 'rb', value: 'a', disabled: true},
- {xtype: 'radiobutton', label: '单选2', name: 'rb', value: 'b'},
- {xtype: 'radiobutton', label: '单选3', name: 'rb', value: 'c'},
- {xtype: 'radiobutton', label: '单选4', name: 'rb', value: 'd', checked: true},
- ], [
- {xtype: 'offset'},
- {
- xtype: 'button', text: '提交', class: 'button-blue', onClick: function () {
- var vr = $form1.formGet(true);
- if (!vr.validate) {
- $.yvan.msg('校验未通过!');
- console.log(vr);
- return;
- }
- $.yvan.alert('<pre>' + JSON.stringify(vr, null, ' ') + '</pre>');
- }
- }, {
- xtype: 'button', text: '清空', class: 'button-gray', onClick: function () {
- $form1.formClear();
- }
- }, {
- xtype: 'button', text: '设值', class: 'button-yellow', onClick: function () {
- $form1.formSet({
- createAt: $.yvan.getMoment().format('YYYY-MM-DD'),
- createAtTime: $.yvan.getMoment().format('YYYY-MM-DD HH:mm:ss'),
- beActive: 'Y',
- packingType: '17',
- whareaCode: 'AA',
- whareaName: 'BB',
- checkA11: 99,
- checkA12: 0,
- checkA13: 0,
- checkA14: 99,
- checkA21: 99,
- checkA22: 0,
- checkA23: 0,
- checkA24: 0,
- rb: 'a'
- });
- }
- },
- ]
- ]
- },
- group1,
- group2
- ]
- }
- };
- };
- });
|