| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- 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'
- }],
- mainFieldConfig: {
- readOnly: true,
- defaultReadOnly: true,
- },
- supFieldConfig: {
- xtype: 'numberfield',
- readOnly: true,
- defaultReadOnly: true,
- defaultValue: 1,
- decimalPrecision: 6,
- vtype: 'positiveNumber'
- }
- }, {
- name: "sa_turnstatus",
- 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_prodbrand'
- },{
- from: 'pr_orispeccode', to: 'sd_orispeccode'
- },{
- from: 'id', to: 'sd_prodid'
- }]
- }
- }, {
- text: "物料名称",
- width: 150.0,
- dataIndex: "sd_proddetail"
- }, {
- text: "品牌",
- width: 100.0,
- dataIndex: "sd_prodbrand"
- }, {
- 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();
- },
- });
|