| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270 |
- Ext.Loader.setConfig({
- enabled: true
- });
- Ext.Loader.setPath('Ext.ux', '../../res/extjs/examples/ux');
- Ext.require([
- 'Ext.grid.*',
- 'Ext.data.*',
- 'Ext.ux.RowExpander',
- 'Ext.selection.CheckboxModel'
- ]);
- var StatusStore;
- var baseUrl;
- var centerLng;
- var centerLat;
- var company_code;
- var theme;
- var ConfirmStore
- var pieWidth;
- var showAlarm = null;
- var pieMask;
- var V_LOGINNAME = '', V_PASSWORD = '';
- var maxHeight = 10000;
- var maxWidth = 10000;
- var companyName = null;
- var sm = Ext.create('Ext.selection.CheckboxModel');
- Ext.define('groupManageOption', {
- extend: 'Ext.data.Model',
- fields: [
- {name: 'id', type: 'int'},
- {name: 'groupName', type: 'string'},
- {name: 'groupAddr', type: 'string'},
- {name: 'mainNumber', type: 'int'},
- {name: 'detectorNumbers', type: 'int'},
- {name: 'peopleNumber', type: 'int'},
- {name: 'companyCode', type: 'string'},
- {name: 'time', type: 'string'},
- {name: 'status', type: 'int'},
- ]
- });
- var getCurrentData = function () {
- var query = {};
- query.V_LOGINNAME = V_LOGINNAME;
- query.V_PASSWORD = V_PASSWORD;
- query.dwtype = '7';
- query.COMMSTATUS = 'NO';
- if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
- query.company_code = company_code;
- // pieMask.show();
- $.ajax({
- type: 'POST',
- url: baseUrl + "iot/alarm/view/getConfirmStatusByDays",
- data: {
- queryJson: Ext.JSON.encode(query)
- },
- success: function (result) {
- var json = eval('(' + result + ')');
- if (json.action == 'getConfirmStatusByDays') {
- if (json.check == 'true') {
- ConfirmStore = json.RESULT;
- if (json.company_name != null)
- companyName = json.company_name;
- else
- companyName = null;
- } else {
- Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function () {
- window.parent.frames.return_login();
- });
- }
- }
- }
- });
- }
- var body_resize = function () {
- maxHeight = document.documentElement.clientHeight;
- maxWidth = document.documentElement.clientWidth;
- Ext.getCmp('ManageOptionPanel').setHeight(maxHeight);
- Ext.getCmp('ManageOptionPanel').setWidth(maxWidth);
- }
- Ext.define('CompanyComboStore', {
- extend: 'Ext.data.Model',
- fields: [
- {name: 'owner_name', type: 'string'},
- {name: 'owner_id', type: 'string'}
- ]
- });
- Ext.define('DeviceTypeStore', {
- extend: 'Ext.data.Model',
- fields: [
- {name: 'deviceTypeName', type: 'string'},
- {name: 'deviceType', type: 'int'}
- ]
- });
- var addradiogroup = new Ext.create('Ext.form.RadioGroup', {
- fieldLabel: '合同状态',
- id: 'addstatus',
- width: 300,
- items: [{
- name: 'stationType',
- inputValue: '1',
- boxLabel: '启用',
- }, {
- name: 'stationType',
- inputValue: '0',
- boxLabel: '未启用',
- //checked:
- }]
- });
- var up_group_radiogroup = new Ext.create('Ext.form.RadioGroup', {
- fieldLabel: '群组启用状态',
- id: 'upstatus',
- width: 300,
- items: [{
- name: 'stationType',
- inputValue: '1',
- boxLabel: '启用',
- }, {
- name: 'stationType',
- inputValue: '0',
- boxLabel: '未启用',
- //checked:
- }]
- });
- Ext.onReady(function () {
- baseUrl = document.getElementById('basePath').value;
- theme = document.getElementById('theme').value;
- company_code = document.getElementById('company_code').value;
- $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
- $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
- V_LOGINNAME = $("#V_LOGINNAME").val();
- V_PASSWORD = $("#V_PASSWORD").val();
- var currentWidth = document.documentElement.clientWidth;
- pieWidth = currentWidth / 7;
- var chkIcon = '<img src="' + baseUrl + 'res/img/common/check.gif"/>'
- var unchkIcon = '<img src="' + baseUrl + 'res/img/common/uncheck.gif"/>'
- var countPerPage = 30;
- var queryJson = {};
- queryJson.V_LOGINNAME = V_LOGINNAME;
- queryJson.V_PASSWORD = V_PASSWORD;
- queryJson.COMMSTATUS = 'NO';
- if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
- queryJson.company_code = company_code;
- var myStore = Ext.create('Ext.data.Store', {
- model: 'groupManageOption',
- pageSize: countPerPage,
- proxy: {
- type: 'ajax',
- actionMethods: {
- create: 'POST',
- read: 'POST', // by default GET
- update: 'POST',
- destroy: 'POST'
- },
- url: baseUrl + 'group/queryGroup',
- reader: {
- type: 'json',
- root: 'RESULT',
- totalProperty: 'totalCount'
- },
- extraParams: {
- queryJson: Ext.JSON.encode(queryJson)
- }
- },
- sorters: [{
- property: 'time',
- direction: 'DESC'
- }],
- remoteSort: true
- });
- myStore.on("load", function (myStore) {
- getCurrentData();
- //do something
- });
- var CompanyStory = Ext.create('Ext.data.Store', {
- model: 'CompanyComboStore',
- proxy: {
- type: 'ajax',
- actionMethods: {
- create: 'POST',
- read: 'POST', // by default GET
- update: 'POST',
- destroy: 'POST'
- },
- url: baseUrl + 'iot/company/view/getNameList',
- //url: baseUrl+'iot/company/view/getNameList',
- reader: {
- type: 'json',
- root: 'RESULT',
- totalProperty: 'totalCount'
- },
- extraParams: {
- queryJson: Ext.JSON.encode(queryJson)
- }
- },
- sorters: [{
- property: 'time',
- direction: 'DESC'
- }],
- remoteSort: true
- });
- var Group_deviceType = Ext.create('Ext.data.Store', {
- model: 'DeviceTypeStore',
- proxy: {
- type: 'ajax',
- actionMethods: {
- create: 'POST',
- read: 'POST', // by default GET
- update: 'POST',
- destroy: 'POST'
- },
- url: baseUrl + 'group/queryDevice',
- //url: baseUrl+'iot/company/view/getNameList',
- reader: {
- type: 'json',
- root: 'RESULT',
- totalProperty: 'totalCount'
- },
- extraParams: {
- queryJson: Ext.JSON.encode(queryJson)
- }
- },
- sorters: [{
- property: 'time',
- direction: 'DESC'
- }],
- remoteSort: true
- });
- var childStore = new Ext.data.Store({
- proxy: new Ext.data.HttpProxy({
- //这里是参数可以顺便写,这个数据源是在第一个下拉框select的时候load的
- url: baseUrl + 'group/queryDevicePoint'
- }),
- reader: new Ext.data.JsonReader({
- root: 'RESULT'
- }, [
- {name: 'id', mapping: 'id'},
- {name: 'mc', mapping: 'name'}
- ])
- });
- myStore.on("load", function (myStore) {
- getCurrentData();
- //do something
- });
- var patroladaddForm = Ext.create('Ext.form.Panel', {
- id: 'patroladaddForm',
- layout: 'form',
- // title:'设备图片:',
- items: [{
- layout: 'hbox',
- items: [{
- xtype: 'box',//或者xtype: 'component',
- title: '点位图片',
- id: 'patrol_add_picture',
- width: 110,//图片宽度
- height: 110,//图片高度
- margin: '0 0 30 150',
- autoEl: {
- tag: 'img',//指定为img标签
- src: '../../res/img/common/shangchaun.png',
- style: 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);width:110px;height:110px;text-align:center;'
- },
- listeners: {
- render: function () {
- Ext.fly(this.el).on("click", function () {
- // add_pic();
- checkfilename();
- });
- }
- }
- }
- ]
- }]
- });
- //新增弹框
- var addGroupWin = function () {
- Ext.create('Ext.window.Window', {
- title: '新增群组',
- height: 500,
- width: 430,
- layout: 'fit',
- items: addGroupInfoForm,
- closable: false,
- modal: true,
- closeAction: 'hide'
- }).show();
- }
- //*************************************修改弹框详情*************************
- var Group_InfoForm = Ext.create('Ext.form.Panel', {
- labelWidth: 55,
- layout: "column",
- url: baseUrl + 'group/updataGroup',
- defaultType: 'textfield',
- fileUpload: true,
- bodyPadding: 15,
- items: [
- {
- fieldLabel: 'id',
- id: 'up_g_id',
- name: 'id',
- displayField: 'id',
- valueField: 'id',
- allowBlank: true,
- blankText: "不能为空",
- editable: false,
- width: 250,
- hidden: true
- }, {
- fieldLabel: 'up_company',
- id: 'up_company',
- name: 'up_company',
- displayField: 'up_company',
- valueField: 'up_company',
- allowBlank: true,
- blankText: "不能为空",
- editable: false,
- width: 250,
- hidden: true
- }, {
- fieldLabel: 'time',
- id: 'up_time',
- name: 'up_time',
- displayField: 'up_time',
- valueField: 'up_time',
- allowBlank: true,
- blankText: "不能为空",
- editable: false,
- width: 250,
- hidden: true
- },
- {
- xtype: 'combo',
- fieldLabel: '单位名称',
- id: 'up_companyCode',
- name: 'company',
- displayField: 'owner_name',
- valueField: 'owner_id',
- allowBlank: true,
- blankText: "不能为空",
- editable: false,
- width: 250,
- store: CompanyStory
- }, {
- fieldLabel: '群组名称',
- allowBlank: true,
- blankText: "不能为空",
- id: 'up_maintenance_company',
- name: 'maintenance_company',
- hidden: false
- },
- {
- fieldLabel: '群组地址',
- allowBlank: true,
- blankText: "不能为空",
- id: 'up_salesman',
- name: 'salesman',
- maxLength: 120,
- anchor: '65%'
- }, {
- fieldLabel: '主机数量',
- id: 'up_salesman_phone',
- name: 'salesman_phone',
- maxLength: 120,
- anchor: '65%'
- }, {
- fieldLabel: '探测器数量',
- id: 'up_customer',
- allowBlank: true,
- blankText: "不能为空",
- name: 'customer',
- maxLength: 50,
- anchor: '15%'
- }, {
- fieldLabel: '人员数量',
- id: 'up_customer_phone',
- allowBlank: true,
- blankText: "不能为空",
- name: 'customer_phone',
- maxLength: 50,
- anchor: '15%'
- }, up_group_radiogroup,
- {
- id: 'up_c_queryJson',
- name: 'queryJson',
- hidden: true
- }],
- buttons: [ /*{
- text: '点击查看文件',
- iconCls: 'cancel_btn',
- handler: function () {
- // alert(fileUrl);
- var l= Ext.getCmp('up_url').getValue();
- window.open(l)
- }
- }*/, {
- text: '提交',
- // id: 'addconfirmBtn',
- iconCls: 'ok_btn',
- handler: function () {
- var form = this.up('form').getForm();
- if (form.isValid()) {
- var queryJson = {};
- queryJson.V_LOGINNAME = V_LOGINNAME;
- queryJson.V_PASSWORD = V_PASSWORD;
- queryJson.companyCode = Ext.getCmp('up_companyCode').getValue();
- queryJson.id = Ext.getCmp('up_g_id').getValue();
- queryJson.salesman = Ext.getCmp('up_salesman').getValue();
- queryJson.maintenanceCompany = Ext.getCmp('up_maintenance_company').getValue();
- queryJson.customerPhone = Ext.getCmp('up_customer_phone').getValue();
- queryJson.customer = Ext.getCmp('up_customer').getValue();
- queryJson.salesmanPhone = Ext.getCmp('up_salesman_phone').getValue();
- queryJson.startTime = Ext.getCmp('up_start_time').getValue();
- queryJson.status = Ext.getCmp('upstatus').getChecked()[0].boxLabel == '启用' ? 1 : 0;
- queryJson.endTime = Ext.getCmp('up_end_time').getValue();
- queryJson.time = Ext.getCmp('up_time').getValue();
- queryJson.url = Ext.getCmp('up_url').getValue();
- queryJson.company = Ext.getCmp('up_company').getValue();
- // queryJson.url = fileUrl;
- // alert(fileUrl);
- var jsonstr = Ext.JSON.encode(queryJson);
- Ext.getCmp('up_c_queryJson').setValue(jsonstr);
- form.submit({
- method: 'post',
- success: function (form, action) {
- Ext.Msg.alert('操作成功', '已确认1条记录', function (btn, txt) {
- clear_add_form();
- myStore.reload();
- // getCurrentData();
- });
- },
- failure: function (form, action) {
- Ext.Msg.alert('操作失败', action.Msg, function (btn, txt) {
- // clear_add_form();
- myStore.reload();
- //
- });
- }
- });
- this.up('window').close();
- }
- }
- },
- {
- text: '关闭',
- iconCls: 'cancel_btn',
- handler: function () {
- this.up('window').close();
- }
- }]
- });
- //********************end**************************
- var GroupInfoWin = Ext.create('Ext.window.Window', {
- id: 'GFileInfoWin',
- title: '群组详情: <span id="VInfoWin_Title"></span>',
- width: 468,
- height: 500,
- layout: 'fit',
- closable: true,
- modal: true,
- closeAction: 'hide',
- items: Group_InfoForm
- });
- var ClztStory = Ext.create('Ext.data.Store', {
- fields: ['status', 'name'],
- data: [
- {'status': '0', 'name': '未启用'},
- {'status': '1', 'name': '启用'}
- ]
- });
- var showGroupInfoWin = function (record) {
- GroupInfoWin.show();
- $("#VInfoWin_Title").html(record.get('data'));
- var data = record.raw;
- console.log(data);
- Ext.getCmp('up_companyCode').setValue(data.companyCode);
- Ext.getCmp('up_id').setValue(data.id);
- Ext.getCmp('up_customer').setValue(data.customer);
- // Ext.getCmp('customer').setValue(data.get('customer'));
- Ext.getCmp('up_customer_phone').setValue(data.customerPhone);
- Ext.getCmp('up_end_time').setValue(data.endTime);
- Ext.getCmp('up_maintenance_company').setValue(data.maintenanceCompany);
- Ext.getCmp('up_salesman').setValue(data.salesman);
- Ext.getCmp('up_salesman_phone').setValue(data.salesmanPhone);
- Ext.getCmp('up_start_time').setValue(data.startTime);
- Ext.getCmp('up_url').setValue(data.url);
- Ext.getCmp('up_company').setValue(data.company);
- Ext.getCmp('up_time').setValue(data.time);
- if (data.status == 1) {
- // checked:true
- Ext.getCmp('upstatus').items.get(0).setValue(true);
- } else {
- Ext.getCmp('upstatus').items.get(1).setValue(true);
- }
- }
- var FilterForm = Ext.create('Ext.form.Panel', {
- id: 'VFireOptionFilterForm',
- labelWidth: 55,
- defaultType: 'textfield',
- bodyPadding: 15,
- items: [{
- xtype: 'combo',
- fieldLabel: '单位名称',
- id: 'ff_company_code',
- name: 'ff_company_code',
- displayField: 'owner_name',
- valueField: 'owner_id',
- editable: false,
- width: 330,
- store: CompanyStory
- },
- {
- xtype: 'combo',
- fieldLabel: '启用状态',
- id: 'ff_qyzt',
- name: 'ff_qyzt',
- displayField: 'name',
- valueField: 'status',
- editable: false,
- width: 330,
- store: ClztStory
- }, {
- xtype: 'datefield',
- fieldLabel: "开始日期",
- format: "Y-m-d",
- id: 'filter_start_time',
- name: "start_data",
- //editable:true,//只读约束
- // width: 330,
- anchor: '80%'
- }
- , {
- xtype: 'datefield',
- fieldLabel: "结束日期",
- minValue: data,
- // '07/07/2017',
- minText: "当前日期选择应大于当天日期",
- format: "Y-m-d",
- // columnWidth:0.5,
- id: 'filter_end_time',
- name: "end_data",
- // editable:true,//只读约束
- anchor: '80%'
- }
- ],
- buttons: [{
- text: '筛选',
- iconCls: 'ok_btn',
- handler: function () {
- var form = this.up('form').getForm();
- if (form.isValid()) {
- var query = {};
- // var tmp = Ext.getCmp('ff_company_code');
- if (Ext.getCmp('ff_company_code').getValue()) {
- query.company_code = Ext.getCmp('ff_company_code').getValue();
- $("#company_code").val(query.company_code);
- company_code = query.company_code;
- $("#FirePiePanel_title_string").html(Ext.getCmp('ff_company_code').getRawValue() + '.维保合同列表');
- } else {
- $("#company_code").val('');
- $("#FirePiePanel_title_string").html('维保合同列表');
- company_code = null;
- }
- if (Ext.getCmp('ff_qyzt').getValue()) {
- query.status = Ext.getCmp('ff_qyzt').getValue();
- $("#status").val(query.status);
- } else {
- $("#status").val('');
- }
- query.status = Ext.getCmp('ff_qyzt').getValue() == null ? "" : Ext.getCmp('ff_qyzt').getValue();
- query.time_start = Ext.getCmp('filter_start_time').getValue() == null ? "" : Ext.getCmp('filter_start_time').getValue();
- query.time_end = Ext.getCmp('filter_end_time').getValue() == null ? "" : Ext.getCmp('filter_end_time').getValue();
- query.V_LOGINNAME = V_LOGINNAME;
- query.V_PASSWORD = V_PASSWORD;
- query.COMMSTATUS = 'NO';
- var jsonstr = Ext.JSON.encode(query);
- myStore.getProxy().extraParams = {
- queryJson: jsonstr
- };
- Ext.getCmp('groupListPageToolbar').moveFirst();
- Ext.getCmp('ff_company_code').setValue('');
- Ext.getCmp('ff_qyzt').setValue('');
- Ext.getCmp('contractManageFilterWin').hide();
- // getCurrentData();
- }
- }
- }, {
- text: '关闭',
- iconCls: 'cancel_btn',
- handler: function () {
- Ext.getCmp('contractManageFilterWin').hide();
- }
- }]
- });
- var filterwin = function () {
- Ext.create('Ext.window.Window', {
- id: 'contractManageFilterWin',
- title: '合同筛选',
- height: 210,
- width: 400,
- layout: 'fit',
- items: FilterForm,
- closable: false,
- modal: true,
- closeAction: 'hide'
- }).show();
- CompanyStory.reload();
- }
- Ext.grid.PageRowNumberer = Ext.extend(Ext.grid.RowNumberer, {
- width: 50,
- text: '序号',
- renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
- if (store.lastOptions.params != null) {
- var pageindex = store.lastOptions.params.start;
- return pageindex + rowIndex + 1;
- } else {
- return rowIndex + 1;
- }
- }
- });
- //=====================页面数据展示====================
- var contractOptionPanel = Ext.create('Ext.grid.Panel', {
- header: {
- height: 0,
- border: '0px solid #000000'
- },
- titleCollapse: true,
- id: 'contractManageOptionPanel',
- region: 'center',
- store: myStore,
- enableColumnResize: true,
- columns: [
- new Ext.grid.PageRowNumberer(),
- {header: 'id', dataIndex: 'id', hidden: true, menuDisabled: true},
- {header: '群组名称', dataIndex: 'groupName', width: '20%', menuDisabled: true, align: 'center'},
- {header: '群组地址', dataIndex: 'groupAddr', width: '20%', menuDisabled: true, align: 'center'},
- {header: '主机数量', dataIndex: 'mainNumber', width: '20%', menuDisabled: true, align: 'center'},
- {header: '探测器数量', dataIndex: 'detectorNumbers', width: '20%', menuDisabled: true, align: 'center'},
- {header: '人员数量', dataIndex: 'peopleNumber', width: '20%', menuDisabled: true, align: 'center'},
- {header: '单位名称', dataIndex: 'companyCode', width: '20%', menuDisabled: true, align: 'center', hidden: true},
- ],
- columnLines: true,
- height: maxHeight,
- width: '100%',
- tbar: new Ext.create('Ext.toolbar.Toolbar', {
- items: [{
- html: '<span id="FirePiePanel_title_string" style="color:#ffffff;background-color:rgba(0,0,0,0)">群组详情</span>'
- }, '->', {
- xtype: 'button',
- iconCls: 'back_btn',
- text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">返回</span>',
- listeners: {
- click: function () {
- location.href = baseUrl + 'view/frontpage/map.jsp?&theme=' + theme + '&company_code=' + company_code;
- }
- }
- }, '-', {
- xtype: 'button',
- iconCls: 'filter_btn',
- text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">筛选</span>',
- listeners: {
- click: filterwin
- }
- }, '-',
- {
- xtype: 'button',
- iconCls: 'append_btn',
- text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">新增</span>',
- listeners: {
- click: addGroupWin
- }
- }]
- }),
- bbar: new Ext.PagingToolbar({
- store: myStore,
- id: 'groupListPageToolbar',
- displayInfo: true,
- pageSize: countPerPage,
- prependButtons: true,
- displayMsg: '显示第 {0}条到 {1}条记录,总共 {2}条',
- emptyMsg: "没有记录",
- firstText: '第一页',
- prevText: '前一页',
- nextText: '后一页',
- lastText: '最后一页',
- refreshText: '刷新'
- }),
- frame: true,
- border: false,
- iconCls: 'icon-grid',
- listeners: {
- 'celldblclick': function (grid, td, cellIndex, record, tr, rowIndex, e, eOpts) {
- // console.log(record.raw.time);
- showGroupInfoWin(record);
- }
- }
- });
- //******************************************************************
- /**
- * 省选择
- */
- /*
- {name: 'owner_name', type: 'string'},
- {name: 'owner_id', type: 'string'}
- */
- Ext.define('App.util.ProviceCombox', {
- alias : 'widget.proviceCombox',
- extend : 'Ext.form.field.ComboBox',
- width: 320,
- bodyPadding: 1,
- fieldLabel : "所属省",
- queryMode : 'local',
- lazyInit : true,
- editable : false,
- triggerAction : 'all',
- layout: 'anchor',
- store : Ext.create('Ext.data.Store', {
- fields : [ "owner_name", "owner_id" ],
- autoLoad : true,
- proxy : {
- type : 'ajax',
- url :baseUrl + 'iot/company/view/getNameList',
- reader : {
- type : 'json',
- root : 'RESULT'
- }
- },
- }),
- allowBlank : false,
- emptyText : '------请选择单位------',
- displayField : 'owner_name',
- valueField : 'owner_id',
- name:"ownerName"
- });
- /**
- * 根据父ID加载市
- * @param com 容器
- * @param fatherId 加载的父ID
- */
- App.util.ProviceCombox.loadCity=function(com,fatherId){
- var cityCombox = com.queryById("cityCombox");
- var countyCombox = com.queryById("countyCombox");
- countyCombox.clearValue();
- cityCombox.clearValue();
- if (fatherId) {
- cityCombox.getStore().load({
- params: {
- "proviceId": fatherId
- }
- });
- }
- }
- /******调用方式*******/
- // {xtype:"proviceCombox",
- // listeners : {
- // "select" : function(fatherType, record, index) {
- // var provinceId = fatherType.getValue();
- // var win = Ext.ComponentQuery.query("personalAdd")[0];
- // var cityCombox = win.down("cityCombox");
- // var countyCombox = win.down("countyCombox");
- // countyCombox.clearValue();
- // cityCombox.clearValue();
- // if (provinceId) {
- // cityCombox.getStore().load({
- // params : {
- // "provinceId" : provinceId
- // }
- // });
- // }
- //
- // }
- // }
- // },{
- // xtype:"cityCombox",
- // listeners : {
- // "select" : function(fatherType, record, index) {
- // var cityId = fatherType.getValue();
- // var win = Ext.ComponentQuery.query("personalAdd")[0];
- // var cityCombox = win.down("countyCombox");
- // var countyCombox = win.down("countyCombox");
- // countyCombox.clearValue();
- // if (cityId) {
- // countyCombox.getStore().load({
- // params : {
- // "cityId" : cityId
- // }
- // });
- // }
- //
- // }
- // }
- // },{
- // xtype:"countyCombox"
- //
- // },
- /**
- * 市选择
- */
- Ext.define('App.util.CityCombox', {
- alias : 'widget.cityCombox',
- extend : 'Ext.form.field.ComboBox',
- width: 320,
- bodyPadding: 1,
- fieldLabel : "设备类型",
- layout: 'anchor',
- queryMode : 'local',
- lazyInit : true,
- editable : false,
- triggerAction : 'all',
- store : Ext.create('Ext.data.Store', {
- fields : [ "deviceTypeName", "deviceType" ],
- //autoLoad : true,
- proxy : {
- type : 'ajax',
- url : baseUrl + 'group/queryDevice',
- reader : {
- type : 'json',
- root : 'RESULT'
- }
- },
- }),
- allowBlank : false,
- emptyText : '----请选类型-----',
- displayField : 'deviceTypeName',
- valueField : 'deviceType',
- name:"deviceType"
- });
- Ext.define('App.util.CountyCombox', {
- alias : 'widget.countyCombox',
- extend : 'Ext.form.field.ComboBox',
- width: 320,
- bodyPadding: 1,
- fieldLabel : "区/县",
- layout: 'anchor',
- queryMode : 'local',
- lazyInit : true,
- editable : false,
- triggerAction : 'all',
- store : Ext.create('Ext.data.Store', {
- fields : [ "countyId", "countyName" ],
- //autoLoad : true,
- proxy : {
- type : 'ajax',
- url : baseUrl + 'iot/company/view/getNameList',
- reader : {
- type : 'json',
- root : 'data'
- }
- },
- }),
- allowBlank : false,
- emptyText : '-----请选择区/县-----',
- displayField : 'countyName',
- valueField : 'countyId',
- name:"countyId"
- });
- /**
- * 根据父ID加载县
- * @param com 容器
- * @param fatherId 加载的父ID
- */
- App.util.CountyCombox.loadCounty=function (com,fatherId) {
- var countyCombox = com.queryById("countyCombox");
- countyCombox.clearValue();
- if (fatherId) {
- countyCombox.getStore().load({
- params: {
- "cityId": fatherId
- }
- });
- }
- }
- //******************************************************************
- function checkfilename() {
- var subwin = window.frames['file_uploader'].contentWindow;
- subwin.setpic();
- }
- var data = Ext.Date.format(new Date(), 'm/d/Y');
- //TODO 新增弹窗
- var addGroupInfoForm = Ext.create('Ext.form.Panel', {
- labelWidth: 55,
- layout: "column",
- url: baseUrl + 'group/addGroup',
- defaultType: 'textfield',
- fileUpload: true,
- bodyPadding: 15,
- items: [
- /******调用方式*******/
- {xtype:"proviceCombox",itemId:"proviceCombox",
- listeners : {
- "select" : function(fatherType, record, index) {
- var provinceId = fatherType.getValue();
- // var fatherId = form.queryById("proviceCombox").getValue();
- var win = Ext.ComponentQuery.query("proviceCombox")[0];
- var cityCombox = win.down("cityCombox");
- var countyCombox = win.down("countyCombox");
- countyCombox.clearValue();
- cityCombox.clearValue();
- if (provinceId) {
- cityCombox.getStore().load({
- params : {
- "provinceId" : provinceId
- }
- });
- }
- }
- }
- },{
- xtype:"cityCombox",itemId:"cityCombox",
- listeners : {
- "select" : function(fatherType, record, index) {
- var cityId = fatherType.getValue();
- var win = Ext.ComponentQuery.query("personalAdd")[0];
- var cityCombox = win.down("countyCombox");
- var countyCombox = win.down("countyCombox");
- countyCombox.clearValue();
- if (cityId) {
- countyCombox.getStore().load({
- params : {
- "cityId" : cityId
- }
- });
- }
- }
- }
- },{
- xtype:"countyCombox",itemId:"countyCombox",
- },
- /*{
- xtype: 'combo',
- fieldLabel: '单位名称',
- id: 'addc_companyCode',
- name: 'company',
- displayField: 'owner_name',
- valueField: 'owner_id',
- emptyText: '请选择单位',
- forceSelection:true,
- allowBlank: true,
- triggerAction:'all',
- blankText: "不能为空",
- editable: false,
- width: 350,
- store: CompanyStory,
- listeners: {
- select: function (combo, record, index) {
- Group_deviceType.proxy = new Ext.data.HttpProxy({url: baseUrl + 'group/queryDevice?queryJson=' + combo.value});
- Group_deviceType.load();
- }
- }
- }, {
- forceSelection: true,//必须选择一项
- mode: 'local',
- xtype: 'combo',
- fieldLabel: '设备类型',
- id: 'add_G_deviceType',
- name: 'devicetype',
- displayField: 'deviceTypeName',
- valueField: 'deviceType',
- allowBlank: true,
- emptyText: '请选择类型设备类型',
- blankText: "不能为空",
- editable: false,
- triggerAction: 'all',
- width: 350,
- store: Group_deviceType,
- /!*listeners: {
- select: function (combo, record, index) {
- // childStore.proxy = new Ext.data.HttpProxy({url: 'group/queryDevicePoint?queryJson=' + combo.value});
- childStore.load();
- }
- }*!/
- }, /!*{
- xtype: 'combo',
- store: childStore,
- valueField: "id",
- displayField: "mc",
- //数据是在本地
- mode: 'local',
- forceSelection: true,//必须选择一项
- emptyText: '请选择子分类...',//默认值
- hiddenName: 'interviewsDetail.child_category',//hiddenName才是提交到后台的input的name
- editable: false,//不允许输入
- triggerAction: 'all',//因为这个下拉是只能选择的,所以一定要设置属性triggerAction为all,不然当你选择了某个选项后,你的下拉将只会出现匹配选项值文本的选择项,其它选择项是不会再显示了,这样你就不能更改其它选项了。
- //allowBlank:false,//该选项值不能为空
- fieldLabel: '选择',
- id: 'child_id',
- name: 'child',
- width: 350
- },*!/ {
- fieldLabel: '维保单位',
- allowBlank: true,
- blankText: "不能为空",
- id: 'addmaintenance_company',
- name: 'maintenance_company',
- maxLength: 120,
- anchor: '65%'
- },
- {
- xtype: 'datefield',
- fieldLabel: "开始日期",
- format: "Y-m-d",
- id: 'addstart_time',
- name: "start_data",
- editable: false,//只读约束
- // width: 330,
- anchor: '80%'
- }
- , {
- xtype: 'datefield',
- fieldLabel: "结束日期",
- minValue: data,
- // '07/07/2017',
- minText: "当前日期选择应大于当天日期",
- format: "Y-m-d",
- // columnWidth:0.5,
- id: 'addend_time',
- name: "end_data",
- editable: false,//只读约束
- anchor: '80%'
- }, {
- fieldLabel: '销售人员',
- allowBlank: true,
- blankText: "不能为空",
- id: 'addsalesman',
- name: 'salesman',
- maxLength: 120,
- anchor: '65%'
- }, addradiogroup, {
- fieldLabel: '销售人员电话',
- id: 'addsalesman_phone',
- name: 'salesman_phone',
- maxLength: 120,
- anchor: '65%'
- }, {
- fieldLabel: '客户联系人',
- id: 'addcustomer',
- allowBlank: true,
- blankText: "不能为空",
- name: 'customer',
- maxLength: 50,
- anchor: '15%'
- }, {
- fieldLabel: '客户电话',
- id: 'addcustomer_phone',
- allowBlank: true,
- blankText: "不能为空",
- name: 'customer_phone',
- maxLength: 50,
- anchor: '15%'
- },/!*uploadfield,*!/
- {
- id: 'addc_queryJson',
- name: 'queryJson',
- hidden: true
- }*/],
- buttons: [{
- text: '提交',
- // id: 'addconfirmBtn',
- iconCls: 'ok_btn',
- handler: function () {
- var form = this.up('form').getForm();
- if (form.isValid()) {
- var queryJson = {};
- queryJson.V_LOGINNAME = V_LOGINNAME;
- queryJson.V_PASSWORD = V_PASSWORD;
- queryJson.companyCode = Ext.getCmp('addc_companyCode').getValue();
- queryJson.salesman = Ext.getCmp('addsalesman').getValue();
- queryJson.maintenanceCompany = Ext.getCmp('addmaintenance_company').getValue();
- queryJson.customerPhone = Ext.getCmp('addcustomer_phone').getValue();
- queryJson.customer = Ext.getCmp('addcustomer').getValue();
- queryJson.salesmanPhone = Ext.getCmp('addsalesman_phone').getValue();
- // queryJson.maintenanceCompany = Ext.getCmp('addsalesman_phone').getValue();
- queryJson.startTime = Ext.getCmp('addstart_time').getValue();
- queryJson.status = Ext.getCmp('addstatus').getChecked()[0].boxLabel == '启用' ? 1 : 0;
- queryJson.endTime = Ext.getCmp('addend_time').getValue();
- queryJson.url = fileUrl;
- var jsonstr = Ext.JSON.encode(queryJson);
- Ext.getCmp('addc_queryJson').setValue(jsonstr);
- form.submit({
- method: 'post',
- success: function (form, action) {
- Ext.Msg.alert('操作成功', '已确认1条记录', function (btn, txt) {
- // clear_add_form();
- myStore.reload();
- // getCurrentData();
- });
- },
- failure: function (form, action) {
- Ext.Msg.alert('操作失败', action.Msg, function (btn, txt) {
- // clear_add_form();
- myStore.reload();
- //
- });
- }
- });
- this.up('window').close();
- }
- }
- },
- {
- text: '点击上传文件',
- iconCls: 'cancel_btn',
- handler: function () {
- var dxjgdm_sel = 100;
- var dxjglx_sel = 100;
- var form = new Ext.form.FormPanel({
- baseCls: 'x-plain',
- labelWidth: 150,
- fileUpload: true,
- defaultType: 'textfield',
- items: [{
- xtype: 'textfield',
- fieldLabel: '请选择要导入的文件',
- name: 'file',
- id: 'userfile',
- inputType: 'file',
- blankText: 'File can\'t not empty.',
- anchor: '100%' // anchor width by percentage
- }]
- });
- var win = new Ext.Window({
- title: '文件导入',
- width: 400,
- height: 150,
- minWidth: 300,
- minHeight: 100,
- layout: 'fit',
- plain: true,
- bodyStyle: 'padding:5px;',
- buttonAlign: 'center',
- items: form,
- buttons: [{
- text: '导入',
- handler: function () {
- if (form.form.isValid()) {
- if (Ext.getCmp('userfile').getValue() == '') {
- Ext.Msg.alert('错误', '请选择你的文件');
- return;
- }
- Ext.MessageBox.show({
- title: '请等待',
- msg: '文件正在导入...',
- progressText: '',
- width: 300,
- progress: true,
- closable: true,
- animEl: 'loding'
- });
- form.getForm().submit({
- url: baseUrl + 'contract/contractFileUpload',
- method: 'POST',
- success: function (form, action) {
- Ext.Msg.alert("系统提示", "文件上传成功!");
- fileUrl = action.result.url
- // console.log(form);
- win.close();
- },
- failure: function () {
- Ext.Msg.alert("系统提示", "文件上传失败!(上传文件类型不对或文件过大)");
- }
- })
- } else {
- Ext.Msg.alert("系统提示", "请选择文件后再上传!");
- }
- }
- }, {
- text: '关闭',
- handler: function () {
- win.close();
- }
- }]
- });
- win.show();
- }
- },
- {
- text: '关闭',
- iconCls: 'cancel_btn',
- handler: function () {
- this.up('window').close();
- }
- }]
- });
- new Ext.create('Ext.panel.Panel', {
- width: '100%',
- id: 'ManageOptionPanel',
- layout: 'border',
- items:
- contractOptionPanel,
- renderTo: Ext.getBody()
- });
- myStore.reload();
- // getCurrentData();
- $(window).resize(function () {
- body_resize();
- });
- body_resize();
- });
|