123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- Ext.define('saas.view.make.bomComposite.QueryPanel_bomexpand', {
- extend: 'Ext.tree.Panel',
- xtype: 'make-bomcomposite-querypanel-bomexpand',
- plugins: [
- 'gridexporter',
- ],
- rootVisible: false,
- bufferedRenderer: false,
- animate: true,
- hideRadio:false,
- _code:null,
- initComponent: function () {
- var me = this;
-
- Ext.apply(me, {
- columns: [{
- xtype: 'rownumberer',
- text: '序号',
- width: 50
- }, {
- text: '层级',
- dataIndex: 'bs_level',
- align: 'right',
- width: 50
- },{
- text: '母件编号',
- dataIndex: 'bs_mothercode',
- hidden: true
- }, {
- text: '母件名称',
- dataIndex: 'mo_proddetail',
- hidden: true
- }, {
- text: '母件规格',
- dataIndex: 'mo_prodspec',
- hidden: true
- }, {
- text: '物料编号',
- dataIndex: 'bs_soncode',
- xtype: 'treecolumn',
- width: 300
- }, {
- text: '物料名称',
- dataIndex: 'son_proddetail',
- width: 200
- }, {
- text: '物料规格',
- dataIndex: 'son_prodspec',
- width: 200
- }, {
- text: '单位',
- dataIndex: 'son_produnit',
- width: 60
- }, {
- text: '单位用量',
- dataIndex: 'bs_baseqty',
- width: 80,
- align: 'right'
- },{
- text: 'BOM序号',
- align: 'center',
- dataIndex: 'bs_bddetno'
- }, {
- text: '位号',
- dataIndex: 'bs_location',
- width: 150
- }, {
- text: '工作中心',
- dataIndex: 'bs_wcname'
- }, {
- text: '备注',
- dataIndex: 'bs_remark'
- }, {
- text: '型号',
- dataIndex: 'son_prodorispec',
- width: 200
- }, {
- text: '厂家/品牌',
- dataIndex: 'son_prodbrand'
- }],
- tbar: [{
- xtype: 'radiogroup',
- name: 'redio_bomexpand',
- width: 300,
- simpleValue: true,
- hidden:me.hideRadio,
- items: [
- { boxLabel: '多级展开', inputValue: '/api/make/bom/bomStruct/', checked: true },
- { boxLabel: '单级展开', inputValue: '/api/make/bom/bomStructOne/' }
- ],
- listeners:{
- change:function(){
- me.store.reload();
- }
- }
- }],
- store: {
- type: 'tree',
- model: 'make.model.make.BomExpand',
- proxy: {
- type: 'ajax',
- url: '/api/make/bom/bomStruct',
- timeout: 8000,
-
- actionMethods: {
- read: 'GET'
- },
- reader: {
- type: 'json'
- },
- listeners: {
- exception: function (proxy, response, operation, eOpts) {
- if (operation.success) {
- if (response.timedout) {
- saas.util.BaseUtil.showErrorToast('请求超时');
- }
- } else {
- if (response.timedout) {
- saas.util.BaseUtil.showErrorToast('请求超时');
- } else {
- console.error('exception: ', response);
- var message = response.responseJson ? (response.responseJson.message == null ? '没有数据' : response.responseJson.message) : '请求超时';
- saas.util.BaseUtil.showErrorToast('查询失败:' + message);
- }
- }
- }
- }
- },
- listeners: {
- beforeload: function (store, op) {
- if(me._code){
- //bom表单点击展开
- store.getProxy().url = '/api/make/bom/bomStruct/' + me._code;
- }else {
- if(me.ownerCt){
- var prCode = me.ownerCt.ownerCt.down('productDbfindTrigger').getRawValue();
- if(prCode){
- store.getProxy().url = me.down('radiogroup[name=redio_bomexpand]').lastValue + prCode;
- }else{
- return false;
- }
- }else{
- return false;
- }
- }
- }
- }
- }
- });
- me.callParent(arguments);
- }
- });
|