|
|
@@ -0,0 +1,158 @@
|
|
|
+/**
|
|
|
+ * 产品库
|
|
|
+ */
|
|
|
+Ext.define('saas.view.sale.business.Product', {
|
|
|
+ extend: 'saas.view.core.base.BasePanel',
|
|
|
+ xtype: 'sale-business-product',
|
|
|
+
|
|
|
+ controller: 'sale-business-Product',
|
|
|
+ viewModel: 'sale-business-Product',
|
|
|
+ viewName: 'sale-business-Product',
|
|
|
+
|
|
|
+
|
|
|
+ // dataUrl: 'http://10.1.80.23:8560/api/sale/sale/enterprise/businessChance',
|
|
|
+ dataUrl: '/api/sale/sale/enterprise/businessChance',
|
|
|
+ initComponent: function() {
|
|
|
+ var me = this;
|
|
|
+ Ext.apply(this, {
|
|
|
+ searchField: [{
|
|
|
+ xtype: 'textfield',
|
|
|
+ name: 'keyword',
|
|
|
+ columnWidth: 0.15,
|
|
|
+ emptyText:'请输入物料编号/名称/型号/品牌'
|
|
|
+ }, {
|
|
|
+ xtype: 'combobox',
|
|
|
+ name: 'uploaded',
|
|
|
+ fieldLabel: '上传状态',
|
|
|
+ queryMode: 'local',
|
|
|
+ displayField: 'name',
|
|
|
+ valueField: 'value',
|
|
|
+ emptyText :'全部',
|
|
|
+ editable:false,
|
|
|
+ labelWidth: 80,
|
|
|
+ columnWidth: 0.2,
|
|
|
+ store: Ext.create('Ext.data.ArrayStore', {
|
|
|
+ fields: ['name', 'value'],
|
|
|
+ data: [
|
|
|
+ ["全部", "all"],
|
|
|
+ ["未上传", "0"],
|
|
|
+ ["已上传", "1"]
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ }, {
|
|
|
+ xtype: 'checkbox',
|
|
|
+ name: 'self',
|
|
|
+ fieldLabel: '我的产品库'
|
|
|
+ }],
|
|
|
+
|
|
|
+ gridConfig: {
|
|
|
+ dataUrl: me.dataUrl,
|
|
|
+ rootProperty: 'data.content',
|
|
|
+ totalProperty: 'data.totalElements',
|
|
|
+ actionColumn: [],
|
|
|
+ selModel: {
|
|
|
+ type: 'cellmodel'
|
|
|
+ },
|
|
|
+ hiddenTools: true,
|
|
|
+ data: [{
|
|
|
+
|
|
|
+ }],
|
|
|
+ columns : [{
|
|
|
+ text: '物料编号',
|
|
|
+ dataIndex: 'custName',
|
|
|
+ width: 120
|
|
|
+ }, {
|
|
|
+ text: '品牌',
|
|
|
+ dataIndex: 'prodBrand',
|
|
|
+ width: 100
|
|
|
+ }, {
|
|
|
+ text: '名称',
|
|
|
+ dataIndex: 'prodName',
|
|
|
+ width: 120
|
|
|
+ }, {
|
|
|
+ text: '型号',
|
|
|
+ dataIndex: 'prodOrispeccode',
|
|
|
+ width: 120
|
|
|
+ }, {
|
|
|
+ text: '规格',
|
|
|
+ dataIndex: 'prodSpec',
|
|
|
+ width: 120
|
|
|
+ }, {
|
|
|
+ text: '单位',
|
|
|
+ dataIndex: 'prodUnit'
|
|
|
+ }, {
|
|
|
+ text: '上传状态',
|
|
|
+ dataIndex: 'needQty'
|
|
|
+ }, {
|
|
|
+ text: '我的产品',
|
|
|
+ dataIndex: 'startDate'
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ });
|
|
|
+ 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;
|
|
|
+ },
|
|
|
+
|
|
|
+ getExtraParams: function(store, op, condition) {
|
|
|
+ var temp = {};
|
|
|
+
|
|
|
+ for(let x = 0; x < condition.length; x++) {
|
|
|
+ let c = condition[x];
|
|
|
+ if(c.field == 'keyword') {
|
|
|
+ temp.keyword = c.value;
|
|
|
+ }else if(c.field == 'date') {
|
|
|
+ temp.fromDate = new Date(c.value.split(',')[0]).getTime();
|
|
|
+ temp.endDate = new Date(c.value.split(',')[1]).getTime();
|
|
|
+ }else if(c.field == 'quoted') {
|
|
|
+ temp.quoted = c.value == 'all' ? null : c.value;
|
|
|
+ }else if(c.field == 'closed') {
|
|
|
+ // temp.endDate = c.value == 'all' ? null : (
|
|
|
+ // c.value == '0' ?
|
|
|
+ // );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let obj = {
|
|
|
+ pageNumber: store.exportNumber?store.exportNumber:op._page,
|
|
|
+ pageSize: store.exportPageSize?store.exportPageSize:store.pageSize
|
|
|
+ };
|
|
|
+ for(let k in temp) {
|
|
|
+ if(!!temp[k]) {
|
|
|
+ obj[k] = temp[k];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ },
|
|
|
+});
|