|
|
@@ -0,0 +1,236 @@
|
|
|
+Ext.define('saas.view.sale.b2b.PurchaseDetail', {
|
|
|
+ extend: 'saas.view.core.form.FormPanel',
|
|
|
+ xtype: 'sale-b2b-purchasedetail',
|
|
|
+
|
|
|
+ controller: 'sale-b2b-purchasedetail',
|
|
|
+ viewModel: 'sale-b2b-purchasedetail',
|
|
|
+
|
|
|
+ viewName: 'sale-b2b-purchasedetail',
|
|
|
+
|
|
|
+ //字段属性
|
|
|
+ _title: '客户采购单',
|
|
|
+ _idField: 'id',
|
|
|
+ _codeField: 'sa_code',
|
|
|
+ _statusField: null,
|
|
|
+ _statusCodeField: null,
|
|
|
+ _auditmanField: 'sa_auditman',
|
|
|
+ _auditdateField: 'sa_auditdate',
|
|
|
+ _relationColumn: 'sd_puid',
|
|
|
+ // _readUrl: 'http://10.1.80.35:8560/api/sale/saledown/read',
|
|
|
+ _readUrl: '/api/sale/saledown/read',
|
|
|
+ // _saveUrl: 'http://10.1.80.35:8560/api/sale/saledown/update',
|
|
|
+ _saveUrl: '/api/sale/saledown/update',
|
|
|
+ // _toSaleUrl: 'http://10.1.80.35:8560/api/sale/saledown/toSale',
|
|
|
+ _toSaleUrl: '/api/sale/saledown/toSale',
|
|
|
+ initId: 0,
|
|
|
+
|
|
|
+ codeInHeader: false,
|
|
|
+
|
|
|
+ initComponent: function () {
|
|
|
+ Ext.apply(this, {
|
|
|
+ defaultItems: [{
|
|
|
+ xtype: 'textfield',
|
|
|
+ name: 'sa_pocode',
|
|
|
+ fieldLabel: '客户PO',
|
|
|
+ readOnly: true
|
|
|
+ }, {
|
|
|
+ xtype: "datefield",
|
|
|
+ name: "createTime",
|
|
|
+ fieldLabel: "单据日期",
|
|
|
+ readOnly: true
|
|
|
+ }, {
|
|
|
+ xtype: 'condbfindtrigger',
|
|
|
+ fieldLabel: '币别汇率',
|
|
|
+ allowBlank: false,
|
|
|
+ readOnly: true,
|
|
|
+ dbType: 'currencyDbfindTrigger',
|
|
|
+ dbfinds: [{
|
|
|
+ from: 'cr_name', to: 'sa_currency'
|
|
|
+ }, {
|
|
|
+ from: 'cr_rate', to: 'sa_rate'
|
|
|
+ }],
|
|
|
+ supFieldConfig: {
|
|
|
+ xtype: 'numberfield',
|
|
|
+ readOnly: false,
|
|
|
+ defaultReadOnly: false,
|
|
|
+ defaultValue: 1,
|
|
|
+ decimalPrecision: 6,
|
|
|
+ vtype: 'positiveNumber'
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ name: "sa_status",
|
|
|
+ xtype: "textfield",
|
|
|
+ fieldLabel: "单据状态",
|
|
|
+ readOnly: true
|
|
|
+ }, {
|
|
|
+ xtype: 'textfield',
|
|
|
+ name: 'sa_custname',
|
|
|
+ fieldLabel: '客户名称',
|
|
|
+ columnWidth: 0.5,
|
|
|
+ readOnly: true
|
|
|
+ }, {
|
|
|
+ xtype: 'textfield',
|
|
|
+ name: 'sa_toplace',
|
|
|
+ fieldLabel: '交货地址',
|
|
|
+ columnWidth: 0.5,
|
|
|
+ readOnly: true
|
|
|
+ }, {
|
|
|
+ name: "detailGridField",
|
|
|
+ xtype: "detailGridField",
|
|
|
+ detnoColumn: 'sd_detno',
|
|
|
+ storeModel: 'saas.model.sale.b2b.PurchaseDetail',
|
|
|
+ deleteDetailUrl: '/api/sale/sale/deleteDetail',
|
|
|
+ allowEmpty: true,
|
|
|
+ columns: [{
|
|
|
+ text: 'id',
|
|
|
+ dataIndex: 'id',
|
|
|
+ hidden: true,
|
|
|
+ }, {
|
|
|
+ text: '物料id',
|
|
|
+ dataIndex: 'sd_prodid',
|
|
|
+ hidden: true
|
|
|
+ }, {
|
|
|
+ text: "物料编号",
|
|
|
+ width: 150.0,
|
|
|
+ dataIndex: "sd_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: "productDbfindTrigger",
|
|
|
+ dbfinds: [{
|
|
|
+ from: 'pr_code', to: 'sd_prodcode'
|
|
|
+ }, {
|
|
|
+ from: 'pr_detail', to: 'sd_proddetail'
|
|
|
+ }, {
|
|
|
+ from: 'pr_spec', to: 'sd_prodspec'
|
|
|
+ },{
|
|
|
+ from: 'pr_brand', to: 'sd_proddbrand'
|
|
|
+ },{
|
|
|
+ from: 'pr_orispeccode', to: 'sd_orispeccode'
|
|
|
+ },{
|
|
|
+ from: 'id', to: 'sd_prodid'
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: "物料名称",
|
|
|
+ width: 150.0,
|
|
|
+ dataIndex: "sd_proddetail"
|
|
|
+ }, {
|
|
|
+ text: "品牌",
|
|
|
+ width: 100.0,
|
|
|
+ dataIndex: "sd_proddbrand"
|
|
|
+ }, {
|
|
|
+ text: "型号",
|
|
|
+ width: 200.0,
|
|
|
+ dataIndex: "sd_orispeccode",
|
|
|
+ ignore: true
|
|
|
+ }, {
|
|
|
+ text: "规格",
|
|
|
+ width: 200,
|
|
|
+ dataIndex: "sd_prodspec"
|
|
|
+ }, {
|
|
|
+ text: '客户料号',
|
|
|
+ width: 120,
|
|
|
+ dataIndex: 'sd_custprodcode',
|
|
|
+ }, {
|
|
|
+ text: '客户型号',
|
|
|
+ width: 120,
|
|
|
+ dataIndex: 'sd_custorispeccode',
|
|
|
+ }, {
|
|
|
+ text: '客户规格',
|
|
|
+ dataIndex: 'sd_custprodspec',
|
|
|
+ width: 120
|
|
|
+ }, {
|
|
|
+ text: "数量",
|
|
|
+ dataIndex: "sd_qty",
|
|
|
+ width: 110.0,
|
|
|
+ xtype: 'numbercolumn',
|
|
|
+ allowBlank: false,
|
|
|
+ renderer: function(v, m, r) {
|
|
|
+ return saas.util.BaseUtil.numberFormat(v, 3, false);
|
|
|
+ },
|
|
|
+ summaryType: 'sum',
|
|
|
+ summaryRenderer: function(v, d, f, m) {
|
|
|
+ return saas.util.BaseUtil.numberFormat(v, 3, false);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: "单位",
|
|
|
+ width: 65.0,
|
|
|
+ dataIndex: "sd_produnit",
|
|
|
+ ignore: true,
|
|
|
+ renderer: function (v, m, r) {
|
|
|
+ if (!v) {
|
|
|
+ return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: "含税单价(元)",
|
|
|
+ xtype: 'numbercolumn',
|
|
|
+ dataIndex: "sd_price",
|
|
|
+ width: 120,
|
|
|
+ renderer: function(v, m, r) {
|
|
|
+ return saas.util.BaseUtil.numberFormat(v, 4, true);
|
|
|
+ },
|
|
|
+ listeners: {
|
|
|
+ edit: function (value, grid) {
|
|
|
+ var r = grid.getSelection()[0],
|
|
|
+ sd_taxrate = r.get('sd_taxrate');
|
|
|
+ var v = value / (1 + sd_taxrate / 100);
|
|
|
+ r.set('sd_netprice', Number(saas.util.BaseUtil.numberFormat(v, 4, false)));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: "税率(%)",
|
|
|
+ xtype: 'numbercolumn',
|
|
|
+ dataIndex: "sd_taxrate",
|
|
|
+ width: 80,
|
|
|
+ renderer: function(v, m, r) {
|
|
|
+ return saas.util.BaseUtil.numberFormat(v, 2, false);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: "价税合计(元)",
|
|
|
+ xtype: 'numbercolumn',
|
|
|
+ dataIndex: "sd_total",
|
|
|
+ width: 120,
|
|
|
+ renderer: function(v, m, r) {
|
|
|
+ return saas.util.BaseUtil.numberFormat(v, 2, true);
|
|
|
+ },
|
|
|
+ summaryType: 'sum',
|
|
|
+ summaryRenderer: function(v, d, f, m) {
|
|
|
+ return saas.util.BaseUtil.numberFormat(v, 2, true);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: "交货日期",
|
|
|
+ dataIndex: "sd_delivery",
|
|
|
+ width: 110.0,
|
|
|
+ xtype: 'datecolumn',
|
|
|
+ }, {
|
|
|
+ text: "备注",
|
|
|
+ dataIndex: "sd_remark",
|
|
|
+ width: 250,
|
|
|
+ items: null,
|
|
|
+ }]
|
|
|
+ }],
|
|
|
+ toolBtns: [{
|
|
|
+ xtype: 'button',
|
|
|
+ text: '转销售',
|
|
|
+ handler: 'turnSale',
|
|
|
+ }, {
|
|
|
+ xtype: 'button',
|
|
|
+ text: '更新',
|
|
|
+ handler: 'onSave',
|
|
|
+ }]
|
|
|
+ });
|
|
|
+ this.callParent();
|
|
|
+ },
|
|
|
+});
|