| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- /**
- * 客户采购单
- */
- Ext.define('saas.view.sale.b2b.Purchase', {
- extend: 'saas.view.core.base.BasePanel',
- xtype: 'sale-b2b-purchase',
- // controller: 'sale-b2b-purchase',
- // viewModel: 'sale-b2b-purchase',
- viewName: 'sale-b2b-purchase',
- // dataUrl: 'http://10.1.80.35:8560/api/sale/saledown/list',
- dataUrl: '/api/sale/saledown/list',
- initComponent: function() {
- var me = this;
- Ext.apply(this, {
- searchField: [{
- xtype: 'textfield',
- name: 'sa_custname',
- columnWidth: 0.15,
- emptyText:'请输入客户名称'
- }, {
- xtype: 'condatefield',
- name: 'createTime',
- fieldLabel: '日期',
- columnWidth: 0.5,
- labelWidth: 50,
- }, {
- xtype: 'textfield',
- name: 'sa_salecode',
- labelWidth: 0,
- columnWidth: 0.15,
- emptyText: '销售单号'
- }, {
- xtype: 'checkbox',
- name: 'sa_sendstatus',
- fieldLabel: '已结案',
- columnWidth: 0.1,
- labelWidth: 50,
- getCondition: function(v) {
- if(v) {
- return "sa_sendstatus='已关闭'";
- }else {
- return '1=1';
- }
- }
- }, {
- xtype: 'checkbox',
- name: 'sa_sendstatus',
- fieldLabel: '待出货',
- columnWidth: 0.1,
- labelWidth: 50,
- getCondition: function(v) {
- if(v) {
- return "sa_sendstatus='未出库'";
- }else {
- return '1=1';
- }
- }
- }],
-
- caller: null,
- _formXtype: null,
- _title: null,
- _deleteUrl: null,
- _batchOpenUrl: null,
- _batchCloseUrl: null,
- _batchDeleteUrl: null,
-
- gridConfig: {
- idField: null,
- codeField: null,
- statusCodeField: null,
- dataUrl: me.dataUrl,
- caller: null,
- rootProperty: 'data.list',
- totalProperty: 'data.total',
- actionColumn: [],
- selModel: {
- type: 'cellmodel'
- },
- hiddenTools: true,
- data: [{
- }],
- columns : [{
- text: 'ID',
- dataIndex: 'id',
- hidden: true,
- width: 100
- }, {
- text: '转单状态',
- dataIndex: 'sa_turnstatus',
- width: 100,
- textAlign: 'center'
- }, {
- text: '客户PO',
- dataIndex: 'sa_pocode',
- width: 160
- }, {
- text: '订单日期',
- xtype: 'datecolumn',
- dataIndex: 'createTime',
- width: 160,
- format: 'Y-m-d H:i:s'
- }, {
- text: '客户编号',
- dataIndex: 'sa_custcode',
- width: 120
- }, {
- text: '客户名称',
- dataIndex: 'sa_custname',
- width: 200
- }, {
- text: '销售单号',
- dataIndex: 'sa_salecode',
- width: 120
- }, {
- text: '出货状态',
- dataIndex: 'sa_sendstatus',
- textAlign: 'center'
- }, {
- text: '交货地址',
- dataIndex: 'sa_toplace',
- width: 250
- }],
- listeners: {
- itemclick: function(view, record, item, index, e, eOpts) {
- saas.util.BaseUtil.openTab('sale-b2b-purchasedetail', '客户采购单', 'sale-b2b-purchasedetail'+record.id, {
- initId: record.get('id')
- });
- }
- }
- },
- });
- this.callParent(arguments);
- },
- /**
- * 处理部分字段值
- */
- getConditionValue: function (field, value) {
- var me = this,
- xtypes = field.getXTypes().split('/'),
- conditionValue;
- if (me.isContainsAny(xtypes, ['datefield'])) {
- conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
- } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
- var from = value.from,
- to = value.to;
- conditionValue = from + ',' + to;
- } else if (me.isContainsAny(xtypes, ['condatefield'])) {
- var from = value.from,
- to = value.to;
- conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
- } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
- conditionValue = value;
- } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
- conditionValue = value;
- } else if (me.isContainsAny(xtypes, ['multicombo'])) {
- conditionValue = value.map ? value.map(function (v) {
- return v.value;
- }).join(',') : '';
- } else {
- conditionValue = value;
- }
- return conditionValue;
- }
- });
|