123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- define(function (require) {
- return function (context) {
- var $dlg, $form, isEdit = false;
- return {
- xtype: 'dialog',
- dialogId: 'dialogEnvLog',
- title: context.isEdit ? '编辑特殊人员信息' : '新增特殊人员信息',
- width: 450,
- height: 300,
- onOpen: function () {
- $dlg = $(this);
- if (context.isEdit) {
- $.yvan.ajax({
- loadingMask: false,
- url: api('/qrImg/getDoorById'),
- type: 'GET',
- data: {tuId: context.tuId},
- success: function (data) {
- $dlg.find('form');
- $form.formSet(data.data);
- }
- });
- }
- },
- center: {
- items: {
- width: 450,
- height: 756,
- autoSizeColumns: true,
- xtype: 'formgroup',
- onRender: function () {
- $form = $(this);
- },
- items: [
- [
- {name: 'tuId', xtype: 'hidden'},
- {
- name: 'phone',
- label: '电话',
- required: true,
- validType: 'phoneNum',
- maxlength: 60,
- width: 350,
- },
- {
- name: 'name',
- label: '联系人姓名',
- required: true,
- maxlength: 60,
- width: 350,
- },
- ]
- ],
- }
- },
- buttons: [
- {
- text: "检查电话", iconCls: "fa fa-save", onClick: function () {
- var queryForm = $form.formGet();
- if (queryForm.phone == "") {
- $.yvan.msg('请先选输入电话号码');
- return;
- }
- $.yvan.ajax({
- url: api('/OutUser/getUptownHomeByPhone'),
- data: {phone: queryForm.phone},
- method: 'post',
- async: false,
- success: function (data) {
- if (data.data.linkman != null) {
- $form.formSet({name: data.data.linkman});
- }
- }
- });
- }
- },
- {
- text: "保存", iconCls: "fa fa-save", onClick: function () {
- $.yvan.postForm($form, {
- url: api('/OutUser/saveOutUserHC'),
- success: function (data) {
- if (data.data == 1) {
- $.yvan.msg('保存成功');
- $dlg.window('close');
- if ($.type(context.confirm) === 'function') {
- context.confirm();
- }
- }
- }
- });
- }
- }, {
- text: "关闭", iconCls: "fa fa-times", onClick: function () {
- $dlg.dialog('close');
- }
- }
- ]
- };
- };
- });
|