123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- define(function (require) {
- return function (context) {
- var $form, $form1;
- // 弹框的方式
- var widgets = {
- // 搜索分类检索
- selectTable: {
- url: 'app/whepi/home/selectUptown.js',
- bind: {
- uptownId: 'uptownId',
- uptownName: 'uptownName',
- },
- },
- };
- //检查查询
- function queryGrid1() {
- var obj = $form.formGet();
- if (obj.we == "") {
- $.yvan.msg('请选择电话号码');
- return false;
- }
- return true;
- }
- //检查查询
- function queryGrid2() {
- var obj = $form1.formGet();
- if (obj.uptownId == "") {
- $.yvan.msg('请选择小区');
- return false;
- }
- if (obj.date == "") {
- $.yvan.msg('请选择导出时间');
- return false;
- }
- return true;
- }
- return {
- center: {
- border: false,
- title: '数据处理',
- items: [
- {
- onRender: function () {
- $form = $(this);
- },
- xtype: 'formgroup',
- title: '',
- items: [
- [
- {
- xtype: 'textbox',
- label: '电话号码',
- name: 'we',
- prompt: '请输入要添加的电话号码',
- labelWidth: 'auto',
- id: 'we',
- },
- ]
- ]
- },
- {
- xtype: 'group',
- title: '具体操作',
- items: [
- [{xtype: 'offset'},
- {
- xtype: 'button', text: '升级业委会角色', class: 'button-blue', onClick: function () {
- if (!queryGrid1()) {
- return;
- }
- var a = $form.formGet()
- $.yvan.confirm('确定升级该号码的业委会角色?', {
- yes: function (index) {
- $.yvan.ajax({
- method: 'post',
- url: api('/epi/admin/addRole'),
- data: $form.formGet(),
- success: function (data) {
- $.yvan.msg('操作成功');
- return;
- }
- });
- }
- });
- }
- },
- ],
- ]
- },
- {
- onRender: function () {
- $form1 = $(this);
- },
- xtype: 'formgroup',
- title: '导出数据',
- items: [
- [
- {xtype: 'hidden', name: 'uptownId'},
- {
- xtype: 'searchbox',
- label: '小区',
- name: 'uptownName',
- prompt: "小区",
- width: '400px',
- widget: widgets.selectTable,// 弹出框方法
- labelWidth: '120px',
- onChange: function (value) {
- if (!isNotNullOrEmpty(value)) {
- $form.formSet({
- userId: ''
- })
- }
- },
- },
- {
- name: 'date',
- label: '导出时间',
- prompt: '导出时间',
- xtype: 'datebox',
- labelWidth: 'auto',
- width: 250,
- },
- ]
- ]
- },
- {
- xtype: 'group',
- title: '具体操作',
- items: [
- [{xtype: 'offset'},
- {
- xtype: 'button', text: '导出小区正常家庭上报', class: 'button-blue', onClick: function () {
- if (!queryGrid2()) {
- return;
- }
- var uptownId = $form1.formGet().uptownId;
- var date = $form1.formGet().date;
- window.open(api('/epi/yeweihui/exportRiBao?uptownId=' + uptownId + '&date=' + date));
- }
- },
- {
- xtype: 'button', text: '导出凌云正常家庭上报', class: 'button-blue', onClick: function () {
- var obj = $form1.formGet();
- if (obj.date == "") {
- $.yvan.msg('请选择导出时间');
- return false;
- }
- var date = $form1.formGet().date;
- window.open(api('/epi/lun/exportRiBao?date=' + date));
- }
- },
- {
- xtype: 'button', text: '导出小区家庭上报明细', class: 'button-blue', onClick: function () {
- if (!queryGrid2()) {
- return;
- }
- var uptownId = $form1.formGet().uptownId;
- var date = $form1.formGet().date;
- window.open(api('/epi/yeweihui/EXR?uptownId=' + uptownId + '&date=' + date));
- }
- },
- ],
- ]
- },
- ]
- },
- };
- };
- });
|