| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- Ext.define('saas.view.document.bom.FormPanel', {
- extend: 'saas.view.core.form.FormPanel',
- xtype: 'document-bom-formpanel',
- controller: 'document-bom-formpanel',
- viewModel: 'document-bom-formpanel',
-
- caller:'Bom',
- //字段属性
- _title:'BOM资料',
- _idField: 'id',
- _codeField: 'codefied',
- _statusField: 'bo_status',
- _statusCodeField: 'bo_statuscode',
- _readUrl:'/api/document/bom/read',
- _saveUrl:'/api/document/bom/save',
- _openUrl:'/api/document/bom/open',
- _closeUrl:'/api/document/bom/close',
- _deleteUrl:'/api/document/bom/delete',
- initId:0,
- _deleteMsg: '删除的BOM资料将不能恢复,请确认是否删除?',
- codeInHeader: false,
- defaultButtons:[{
- cls: 'x-formpanel-btn-blue',
- xtype: 'button',
- text: '新增',
- bind: {
- hidden: '{!id}'
- },
- handler: 'add'
- }, {
- xtype: 'button',
- text: '保存',
- handler: 'onSave'
- }, {
- xtype: 'button',
- text: '删除',
- handler: 'delete'
- }, {
- xtype: 'button',
- bind: {
- text: '{auditBtnText}'
- },
- handler: "auditBtnClick",
- }],
- defaultItems: [{
- xtype: 'hidden',
- name: 'id',
- fieldLabel: 'id',
- },{
- xtype: 'hidden',
- name: 'bo_motherid',
- fieldLabel: '产品id'
- },{
- xtype : "productDbfindTrigger",
- name: 'bo_mothercode',
- fieldLabel: '产品编号',
- allowBlank: false
- },{
- xtype: 'textfield',
- name: 'bo_mothername',
- fieldLabel: '产品名称',
- readOnly:true,
- allowBlank: false
- },{
- xtype: 'textfield',
- name: 'pr_spec',
- fieldLabel: '产品规格',
- readOnly:true,
- },{
- xtype: 'textfield',
- name: 'bo_version',
- fieldLabel: '版本',
- allowBlank: false
- }, {
- xtype : "detailGridField",
- detnoColumn: 'bd_detno',
- showCount: false,
- storeModel:'saas.model.document.bomdetail',
- deleteDetailUrl:'/api/document/bom/deleteDetail',
- columns : [
- {
- text : "ID",
- dataIndex : "id",
- hidden : true,
- xtype : "numbercolumn"
- },
- {
- text : "关联ID",
- dataIndex : "bd_bomid",
- hidden : true,
- xtype : "numbercolumn"
- },
- {
- allowBlank:false,
- text : "物料编号",
- dataIndex : "bd_soncode",
- width : 150,
- editor : {
- displayField : "display",
- editable : true,
- format : "",
- hideTrigger : false,
- maxLength : 100.0,
- minValue : null,
- positiveNum : false,
- queryMode : "local",
- store : null,
- valueField : "value",
- xtype : "productMultiDbfindTrigger"
- }
- }, {
- allowBlank:false,
- text : "物料ID",
- hidden : true,
- dataIndex : "bd_sonid",
- },{
- text: 'model映射需要',
- dataIndex: 'productDTO',
- hidden: true,
- }, {
- text : "物料名称",
- dataIndex : "pr_detail",
- width : 200,
- ignore:true,
- renderer: function (v, m, r) {
- if(!v){
- return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
- }
- return v;
- }
- }, {
- text : "物料规格",
- dataIndex : "pr_spec",
- width : 150,
- ignore:true,
- renderer: function (v, m, r) {
- if(!v){
- return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null;
- }
- return v;
- }
- }, {
- text : "单位",
- dataIndex : "bd_unit",
- width : 80
- },
- {
- allowBlank:false,
- text : "用量",
- width : 80,
- dataIndex : "bd_baseqty",
- editor : {
- xtype : "numberfield",
- decimalPrecision: 0,
- minValue:0,
- maxLength: 10,
- listeners: {
- change: function(f, v) {
- if((v+'').length > 10) {
- f.setValue(Number((v+'').substr(0, 10)));
- }
- }
- }
- },
- renderer : function(v) {
- var arr = (v + '.').split('.');
- var xr = (new Array(arr[1].length)).fill('0');
- var format = '0.' + xr.join();
- return Ext.util.Format.number(v, format);
- }
- }, {
- text : "替代料",
- dataIndex : "bd_replace",
- width : 250,
- editor : {
- displayField : "display",
- editable : true,
- format : "",
- hideTrigger : false,
- maxLength : 100.0,
- minValue : null,
- positiveNum : false,
- queryMode : "local",
- store : null,
- valueField : "value",
- xtype : "productAddMultiDbfindTrigger"
- }
- }, {
- text : "备注",
- dataIndex : "bd_remark",
- width : 250,
- items : null,
- editor : {
- xtype : "textfield"
- },
- }]
- }, {
- xtype: 'hidden',
- name: 'bo_statuscode',
- fieldLabel: '状态码',
- readOnly:true,
- defaultValue: ''
- }, {
- xtype: 'textfield',
- name: 'bo_status',
- fieldLabel: '产品状态',
- readOnly:true,
- defaultValue: ''
- },{
- xtype : "textfield",
- name : "creatorName",
- readOnly:true,
- fieldLabel : "录入人"
- },{
- xtype : "datefield",
- name : "createTime",
- fieldLabel : "录入时间"
- }],
- auditTexts: {
- auditCode: 'BANNED',
- auditText: '已禁用',
- unAuditCode: 'ENABLE',
- unAuditText: '已启用',
- auditBtnText: '禁用',
- unAuditBtnText: '启用',
- }
- });
|