Ext.define('saas.view.sale.saleIn.FormPanel', { extend: 'saas.view.core.form.FormPanel', xtype: 'sale-salein-formpanel', controller: 'sale-salein-formpanel', viewModel: 'sale-salein-formpanel', viewName: 'sale-salein-formpanel', caller:'SaleIn', //字段属性 _title:'销售退货单', _idField: 'id', _codeField: 'pi_inoutno', _statusField: 'pi_status', _statusCodeField: 'pi_statuscode', _relationColumn: 'pd_piid', _readUrl:'/api/sale/prodinout/read', _saveUrl:'/api/sale/prodinout/save', _auditUrl:'/api/sale/prodinout/audit', _unAuditUrl:'/api/sale/prodinout/unAudit', _deleteUrl:'/api/sale/prodinout/delete', _turnInUrl:'/api/sale/prodinout/turnProdIn', initId:0, defaultItems: [{ xtype: 'hidden', name: 'id', fieldLabel: 'id' }, { xtype : "textfield", name : "pi_class", fieldLabel : "单据类型", readOnly:true, allowBlank : false, defaultValue:'销售退货单', allowBlank:false },{ xtype : "hidden", name : "pi_custid", fieldLabel : "客户ID" },{ xtype : "hidden", name : "pi_custcode", fieldLabel : "客户编号" }, { xtype : "customerDbfindTrigger", name : "pi_custname", fieldLabel : "客户名称", allowBlank:false, }, { xtype : "datefield", name : "pi_date", fieldLabel : "单据日期", allowBlank : false, columnWidth : 0.25, defaultValue: new Date() }, { xtype : "textfield", name : "pi_address", fieldLabel : "交货地址", columnWidth : 0.5 }, { name : "detailGridField", xtype : "detailGridField", detnoColumn: 'pd_pdno', storeModel:'saas.model.sale.ProdIODetail', deleteDetailUrl:'/api/sale/prodinout/deleteDetail', columns : [ { text : "id", dataIndex : "id", xtype : "numbercolumn", hidden:true }, { text : "物料id", dataIndex : "pd_prodid", width :0 }, { text : "物料编号", width : 150.0, dataIndex : "pd_prodcode", allowBlank:false, editor : { displayField : "display", editable : true, format : "", hideTrigger : false, maxLength : 100.0, minValue : null, positiveNum : false, queryMode : "local", store : null, valueField : "value", xtype : "productMultiDbfindTrigger" } },{ text: 'model映射需要', dataIndex: 'productDTO', hidden: true, }, { text : "名称", dataIndex : "pr_detail", ignore:true, width : 200.0, renderer: function (v, m, r) { if(!v){ return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; } return v; } }, { text : "规格", dataIndex : "pr_spec", ignore:true, width : 150.0, renderer: function (v, m, r) { if(!v){ return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:null; } return v; } }, { text : "数量", xtype: 'numbercolumn', dataIndex : "pd_inqty", width : 110.0, allowBlank:false, editor : { xtype : "numberfield", decimalPrecision: 3, minValue:0 }, renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0'); var format = '0.' + xr.join(); return Ext.util.Format.number(v, format); }, summaryType: 'sum', summaryRenderer: function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0'); var format = '0.' + xr.join(); return Ext.util.Format.number(v, format); } }, { text : "仓库ID", dataIndex : "pd_whid", width : 0 }, { text : "仓库", dataIndex : "pd_whcode", hidden :true }, { text : "仓库", dataIndex : "pd_whname", allowBlank:false, width : 150.0, editor : { displayField : "display", editable : true, format : "", hideTrigger : false, maxLength : 100.0, minValue : null, positiveNum : false, queryMode : "local", store : null, valueField : "value", xtype : "warehouseDbfindTrigger" } }, { text : "单价", xtype: 'numbercolumn', dataIndex : "pd_sendprice", width : 110.0, editor : { xtype : "numberfield", decimalPrecision: 8, minValue:0 }, renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0'); var format = '0,000.' + xr.join(); return Ext.util.Format.number(v, format); }, }, { text : "含税金额", xtype: 'numbercolumn', dataIndex : "pd_ordertotal", width : 110.0, renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0'); var format = '0,000.' + xr.join(); return Ext.util.Format.number(v, format); }, summaryType: 'sum', summaryRenderer: function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0'); var format = '0,000.' + xr.join(); return Ext.util.Format.number(v, format); } }, { text : "税率", xtype: 'numbercolumn', dataIndex : "pd_taxrate", width : 80.0, editor : { xtype : "numberfield", decimalPrecision: 0, minValue: 0, maxValue: 100 }, renderer : function(v) { return Ext.util.Format.number(v, '0'); }, }, { text : "未税金额", xtype: 'numbercolumn', dataIndex : "pd_nettotal", width : 110.0, renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0'); var format = '0,000.' + xr.join(); return Ext.util.Format.number(v, format); }, summaryType: 'sum', summaryRenderer: function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0'); var format = '0,000.' + xr.join(); return Ext.util.Format.number(v, format); } }, { text : "销售订单明细id", dataIndex : "pd_sdid", hidden:true }, { text : "销售单号", dataIndex : "pd_ordercode", width : 150.0 },{ text : "销售序号", dataIndex : "pd_orderdetno", xtype : "numbercolumn", width: 110.0, format: '0', renderer: function(v) { return v ? v : null; } },{ text : "备注", dataIndex : "pd_remark", width : 250, items : null, editor : { xtype : "textfield" }, } ] }, { xtype : "textfield", name : "pi_total", fieldLabel : "单据金额", readOnly: true }, { xtype : "textfield", name : "pi_remark", fieldLabel : "备注", columnWidth : 0.75 },{ xtype : "hidden", name : "creatorId", fieldLabel : "录入人ID", readOnly:true }, { xtype : "textfield", name : "creatorName", fieldLabel : "录入人", readOnly:true }, { xtype : "datefield", name : "createTime", fieldLabel : "录入日期", readOnly:true, defaultValue: new Date() },{ xtype : "hidden", name : "updaterId", fieldLabel : "更新人ID", readOnly:true },{ xtype : "hidden", name : "updaterName", fieldLabel : "更新人", readOnly:true }, { xtype : "hidden", name : "updateTime", fieldLabel : "更新日期", readOnly:true, defaultValue: new Date() }, { xtype : "textfield", name : "pi_auditman", fieldLabel : "审核人", readOnly:true }, { xtype : "datefield", name : "pi_auditdate", fieldLabel : "审核日期", readOnly:true }] });